| <a name="48521"/> Element | <a name="48523"/> Specify in TO_* datetime functions?a | <a name="48525"/> Meaning |
|---|
<a name="48527"/>-
<a name="48528"/>/
<a name="48529"/>,
<a name="48530"/>.
<a name="48531"/>;
<a name="48532"/>:
<a name="48533"/>"text"
| <a name="48535"/> Yes | <a name="48537"/> Punctuation and quoted text is reproduced in the result. |
<a name="48539"/>AD
<a name="48540"/>A.D.
| <a name="48542"/> Yes | <a name="48544"/> AD indicator with or without periods. |
<a name="48546"/>AM
<a name="48547"/>A.M.
| <a name="48549"/> Yes | <a name="48551"/> Meridian indicator with or without periods. |
<a name="48553"/>BC
<a name="48554"/>B.C.
| <a name="48556"/> Yes | <a name="48558"/> BC indicator with or without periods. |
<a name="48560"/>CC
<a name="48561"/>SCC
| <a name="48563"/> No | <a name="48565"/> Century. - <a name="115985"/>If the last 2 digits of a 4-digit year are between 01 and 99 (inclusive), then the century is one greater than the first 2 digits of that year.
- <a name="115990"/>If the last 2 digits of a 4-digit year are 00, then the century is the same as the first 2 digits of that year.
<a name="116001"/>For example, 2002 returns 21; 2000 returns 20. |
<a name="48567"/>D
| <a name="48569"/> Yes | <a name="48571"/> Day of week (1-7). |
<a name="48573"/>DAY
| <a name="48575"/> Yes | <a name="48577"/> Name of day, padded with blanks to length of 9 characters. |
<a name="48579"/>DD
| <a name="48581"/> Yes | <a name="48583"/> Day of month (1-31). |
<a name="48585"/>DDD
| <a name="48587"/> Yes | <a name="48589"/> Day of year (1-366). |
<a name="48591"/>DY
| <a name="48593"/> Yes | <a name="48595"/> Abbreviated name of day. |
<a name="48597"/>E
| <a name="48599"/> No | <a name="48601"/> Abbreviated era name (Japanese Imperial, ROC Official, and Thai Buddha calendars). |
<a name="48603"/>EE
| <a name="48605"/> No | <a name="48607"/> Full era name (Japanese Imperial, ROC Official, and Thai Buddha calendars). |
<a name="48609"/><code>FF [1..9]
</code> | <a name="48611"/> Yes | <a name="48814"/> Fractional seconds; no radix character is printed (use the X format element to add the radix character). Use the numbers 1 to 9 after FF to specify the number of digits in the fractional second portion of the datetime value returned. If you do not specify a digit, then Oracle uses the precision specified for the datetime datatype or the datatype's default precision. <a name="77614"/> Examples:'HH:MI:SS.FF'<a name="77613"/> SELECT TO_CHAR(SYSTIMESTAMP, 'SS.FF3') from dual;
|
<a name="48617"/>HH
| <a name="48619"/> Yes | <a name="48621"/> Hour of day (1-12). |
<a name="48623"/>HH12
| <a name="48625"/> No | <a name="48627"/> Hour of day (1-12). |
<a name="48629"/>HH24
| <a name="48631"/> Yes | <a name="48633"/> Hour of day (0-23). |
<a name="48635"/>IW
| <a name="48637"/> No | <a name="48639"/> Week of year (1-52 or 1-53) based on the ISO standard. |
<a name="48641"/>IYY
<a name="48642"/>IY
<a name="48643"/>I
| <a name="48645"/> No | <a name="48647"/> Last 3, 2, or 1 digit(s) of ISO year. |
<a name="48649"/>IYYY
| <a name="48651"/> No | <a name="48653"/> 4-digit year based on the ISO standard. |
<a name="48655"/>J
| <a name="48657"/> Yes | <a name="48659"/> Julian day; the number of days since January 1, 4712 BC. Number specified with 'J' must be integers. |
<a name="48661"/>MI
| <a name="48663"/> Yes | <a name="48665"/> Minute (0-59). |
<a name="48667"/>MM
| <a name="48669"/> Yes | <a name="48671"/> Month (01-12; JAN = 01). |
<a name="48673"/>MON
| <a name="48675"/> Yes | <a name="48677"/> Abbreviated name of month. |
<a name="48679"/>MONTH
| <a name="48681"/> Yes | <a name="48683"/> Name of month, padded with blanks to length of 9 characters. |
<a name="48685"/>PM
<a name="48686"/>P.M.
| <a name="48688"/> No | <a name="48690"/> Meridian indicator with or without periods. |
<a name="48692"/>Q
| <a name="48694"/> No | <a name="48696"/> Quarter of year (1, 2, 3, 4; JAN-MAR = 1). |
<a name="48698"/>RM
| <a name="48700"/> Yes | <a name="48702"/> Roman numeral month (I-XII; JAN = I). |
<a name="48704"/>RR
| <a name="48706"/> Yes | <a name="51477"/> Lets you store 20th century dates in the 21st century using only two digits. See <a href="sql_elements4a.htm#35239">"The RR Date Format Element"</a><a href="sql_elements4a.htm#35239"/> for detailed information. |
<a name="48710"/>RRRR
| <a name="48712"/> Yes | <a name="48714"/> Round year. Accepts either 4-digit or 2-digit input. If 2-digit, provides the same return as RR. If you don't want this functionality, then simply enter the 4-digit year. |
<a name="48716"/>SS
| <a name="48718"/> Yes | <a name="48720"/> Second (0-59). |
<a name="48722"/>SSSSS
| <a name="48724"/> Yes | <a name="48726"/> Seconds past midnight (0-86399). |
<a name="51500"/>TZD
| <a name="51502"/> Yes | <a name="51504"/> Daylight savings information. The TZD value is an abbreviated time zone string with daylight savings information. It must correspond with the region specified in TZR. <a name="51511"/> Example:PST (for US/Pacific standard time); PDT (for US/Pacific daylight time). |
<a name="48729"/>TZH
| <a name="48731"/> Yes | <a name="48826"/> Time zone hour. (See TZM format element.) <a name="48734"/> Example:'HH:MI:SS.FFTZH:TZM'. |
<a name="48736"/>TZM
| <a name="48738"/> Yes | <a name="48833"/> Time zone minute. (See TZH format element.) <a name="48741"/> Example:'HH:MI:SS.FFTZH:TZM'. |
<a name="51521"/>TZR
| <a name="51523"/> Yes | <a name="51525"/> Time zone region information. The value must be one of the time zone regions supported in the database. <a name="51538"/> Example: US/Pacific |
<a name="48743"/>WW
| <a name="48745"/> No | <a name="48747"/> 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. |
<a name="48749"/>W
| <a name="48751"/> No | <a name="48753"/> Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh. |
<a name="48756"/>X
| <a name="48758"/> Yes | <a name="48840"/> Local radix character. <a name="48761"/> Example:'HH:MI:SSXFF'. |
<a name="48763"/>Y,YYY
| <a name="48765"/> Yes | <a name="48767"/> Year with comma in this position. |
<a name="48769"/>YEAR
<a name="48770"/>SYEAR
| <a name="48772"/> No | <a name="48774"/> Year, spelled out; "S" prefixes BC dates with "-". |
<a name="48776"/>YYYY
<a name="48777"/>SYYYY
| <a name="48779"/> Yes | <a name="48781"/> 4-digit year; "S" prefixes BC dates with "-". |
<a name="48783"/>YYY
<a name="48784"/>YY
<a name="48785"/>Y
| <a name="48787"/> Yes | <a name="48789"/> Last 3, 2, or 1 digit(s) of year. |