MM-DD-RRRR / MM-DD-YYYY 的區別【Blog 搬家】
MM-DD-RRRR / MM-DD-YYYY 的區別 (Date format)
2005 年 08 月 15日
先各位執行一下下面SQL. 結果會如何呢?
select to_date('05/01/02','YYYY-MM-DD') YYYY ,to_date ('05/01/02','RRRR-MM-DD') RRRR
from dual
結果如下:
-------------------------------------------------
YYYY RRRR
0005-01-02 00:00:00 2005-01-02 00:00:00
-------------------------------------------------
什麼原因 ?
RR
Yes Lets you store 20th century dates in the 21st century using only two digits.
See Also: Additional discussion on RR datetime format element in the Oracle Database SQL Reference
RRRR
Yes Round year. Accepts either 4-digit or 2-digit input. If 2-digit, provides the same return as RR. If you do not want this functionality, then enter the 4-digit year.
Yes Lets you store 20th century dates in the 21st century using only two digits.
See Also: Additional discussion on RR datetime format element in the Oracle Database SQL Reference
RRRR
Yes Round year. Accepts either 4-digit or 2-digit input. If 2-digit, provides the same return as RR. If you do not want this functionality, then enter the 4-digit year.
RRRR : 這邊說得如果你輸入的是2位數字 則會轉換為 四位年,如果是四位年,則保持不變。
而 YYYY 只是將同一位置上的字元轉換為要求的字元,如果為數不夠則用0 補充。
這就是RRRR /YYYY 的區別!
By -myhuaer
myhuaer 發表於:2005.08.15 10:50 ::分類: ( Oracle Infomation ) ::閱讀:(491次)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/34596/viewspace-661930/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- blog保姆級別開發流程七
- 搬家公司的選擇
- 部落格搬家
- 搬家成功了!
- 搬家到掘金
- 簡書搬家啦!
- 圖靈搬家啦!圖靈
- 搬家到雲棲啦
- LinkedList和ArrayList的區別、Vector和ArrayList的區別
- http和https的區別/get和post的區別HTTP
- ||和??的區別
- /*和/**的區別
- ??與?:的區別
- 蜂蜜的區別
- Blog的圖床搭建圖床
- First Blog
- GitHub BLOGGithub
- a new blog
- Discuz!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 論壇搬家記錄
- Discuz!! 論壇搬家記錄
- 帝國CMS搬家步驟
- 無厘頭物理模擬搬家遊戲《胡鬧搬家》賣出100萬份遊戲
- UIModalPresentationStyle 各種型別的區別UI型別
- 值型別與引用型別的區別型別
- scala中:: , +:, :+, :::, +++的區別
- jquery $(this) 和this的區別jQuery
- JQuery this和$(this)的區別jQuery
- T和?的區別
- makefile =和:=的區別
- ++a和a++的區別
- @synthesize @dynamic 的區別
- CMM/CMMI 的區別
- ../和./和/的區別
- ./ 和sh 的區別
- JavaScript中的“=、==、===”區別JavaScript
- python 中 is, is not ,==, != 的區別Python
- == euqals hascode的區別
- Golang的值型別和引用型別的範圍、儲存區域、區別Golang型別
- 自增長列和序列的區別(identity與sequence的區別)IDE