日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
DB2時間函數(shù)大全

DB2時間函數(shù)是我們最常見的函數(shù)之一,下面就為您介紹一些DB2時間函數(shù),供您參考,希望可以讓您對DB2時間函數(shù)有更多的了解。

成都創(chuàng)新互聯(lián)公司專注于網(wǎng)站建設(shè)|成都網(wǎng)站維護(hù)公司|優(yōu)化|托管以及網(wǎng)絡(luò)推廣,積累了大量的網(wǎng)站設(shè)計與制作經(jīng)驗,為許多企業(yè)提供了網(wǎng)站定制設(shè)計服務(wù),案例作品覆蓋成都木包裝箱等行業(yè)。能根據(jù)企業(yè)所處的行業(yè)與銷售的產(chǎn)品,結(jié)合品牌形象的塑造,量身制作品質(zhì)網(wǎng)站。

 
 
 
  1. --獲取當(dāng)前日期:  
  2.  
  3. select current date from sysibm.sysdummy1;   
  4. values current date;  
  5.  
  6. --獲取當(dāng)前日期   
  7. select current time from sysibm.sysdummy1;   
  8. values current time;   
  9. --獲取當(dāng)前時間戳   
  10. select current timestamp from sysibm.sysdummy1;   
  11. values current timestamp;   
  12.  
  13. --要使當(dāng)前時間或當(dāng)前時間戳記調(diào)整到 GMT/CUT,則把當(dāng)前的時間或時間戳記減去當(dāng)前時區(qū)寄存器:  
  14.  
  15. values current time -current timezone;   
  16. values current timestamp -current timezone;   
  17.  
  18. --獲取當(dāng)前年份  
  19.  
  20. values year(current timestamp);  
  21.  
  22. --獲取當(dāng)前月   
  23. values month(current timestamp);  
  24.  
  25. --獲取當(dāng)前日   
  26. values day(current timestamp);  
  27.  
  28. --獲取當(dāng)前時   
  29. values hour(current timestamp);  
  30.  
  31. --獲取分鐘   
  32. values minute(current timestamp);  
  33.  
  34. --獲取秒   
  35. values second(current timestamp);  
  36.  
  37. --獲取毫秒   
  38. values microsecond(current timestamp);   
  39.  
  40. --從時間戳記單獨抽取出日期和時間  
  41.  
  42. values date(current timestamp);   
  43. values VARCHAR_FORMAT(current TIMESTAMP,'yyyy-mm-dd');   
  44. values char(current date);   
  45. values time(current timestamp);   
  46.  
  47. --執(zhí)行日期和時間的計算  
  48.  
  49. values current date+1 year;      
  50. values current date+3 years+2 months +15 days;   
  51. values current time +5 hours -3 minutes +10 seconds;   
  52.  
  53. --計算兩個日期之間的天數(shù)  
  54.  
  55. values days(current date)- days(date('2010-02-20'));   
  56.  
  57. --時間和日期換成字符串  
  58.  
  59. values char(current date);   
  60. values char(current time);   
  61.  
  62. --要將字符串轉(zhuǎn)換成日期或時間值  
  63.  
  64. values timestamp('2010-03-09-22.43.00.000000');   
  65. values timestamp('2010-03-09 22:44:36');   
  66. values date('2010-03-09');   
  67. values date('03/09/2010');   
  68. values time('22:45:27');   
  69. values time('22.45.27');   
  70.  
  71. --計算兩個時間戳記之間的時差:  
  72.  
  73. --秒的小數(shù)部分為單位   
  74. values timestampdiff(1,char(current timestamp - timestamp('2010-01-01-00.00.00')));   
  75. --秒為單位   
  76. values timestampdiff(2,char(current timestamp - timestamp('2010-01-01-00.00.00')));   
  77. --分為單位   
  78. values timestampdiff(4,char(current timestamp - timestamp('2010-01-01-00.00.00')));   
  79. --小時為單位   
  80. values timestampdiff(8,char(current timestamp - timestamp('2010-01-01-00.00.00')));   
  81. --天為單位   
  82. values timestampdiff(16,char(current timestamp - timestamp('2010-01-01-00.00.00')));   
  83. --周為單位   
  84. values timestampdiff(32,char(current timestamp - timestamp('2010-01-01-00.00.00')));   
  85. --月為單位   
  86. values timestampdiff(64,char(current timestamp - timestamp('2010-01-01-00.00.00')));   
  87. --季度為單位   
  88. values timestampdiff(128,char(current timestamp - timestamp('2010-01-01-00.00.00')));   
  89. --年為單位   
  90. values timestampdiff(256,char(current timestamp - timestamp('2010-01-01-00.00.00'))); 

【編輯推薦】

DB2公共表表達(dá)式的用法

跨數(shù)據(jù)庫訪問DB2表的方法

DB2表空間大小的限制

深入解讀DB2存儲過程

DB2連接服務(wù)器的配置


分享名稱:DB2時間函數(shù)大全
本文來源:http://m.5511xx.com/article/dppcocj.html