日期:2014-05-16 浏览次数:20407 次
TO_CHAR中很多人格式化日期时会用 TO_CHAR(date,'YYYYMMDD HH24:MM:SS')
小心哦,这个格式是错的,被Java毒害了。
正确的格式串是:YYYYMMDD HH24:MI:SS
?
The following are number examples for the to_char function.
to_char(1210.73, '9999.9') would return '1210.7' to_char(1210.73, '9,999.99') would return '1,210.73' to_char(1210.73, '$9,999.00') would return '$1,210.73' to_char(21, '000099') would return '000021'
?
The following is a list of valid parameters when the to_char function is used to convert a date to a string. These parameters can be used in many combinations.
?
Parameter Explanation YEAR Year, spelled out YYYY 4-digit year YYY
YY
YLast 3, 2, or 1 digit(s) of year. IYY
IY
ILast 3, 2, or 1 digit(s) of ISO year. IYYY 4-digit year based on the ISO standard Q Quarter of year (1, 2, 3, 4; JAN-MAR = 1). MM Month (01-12; JAN = 01). MON Abbreviated name of month. MONTH Name of month, padded with blanks to length of 9 characters. RM Roman numeral month (I-XII; JAN = I). WW Week of year (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year. W Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh. IW Week of year (1-52 or 1-53) based on the ISO standard. 免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。