Table 7–3: Format Specifiers Allowed With TO_CHAR() and
TO_DATE()
Format Specifier
|
Description
|
Comment
|
AM
|
Meridian indicator in the native language
Without periods
|
English only
|
A.M.
|
Meridian indicator in the native language
With periods
|
English only
|
CC
|
The century as a two-digit number
Computed as one greater than the first two digits of the four-digit year
|
Considers 1900 to be in the 20th century, 2000 to be in the 21st century, etc.
|
SCC
|
The century as a two-digit number.
Computed as one greater than the first two digits of the four-digit year
BC dates are prefixed by “-”
|
Considers 1900 to be in the 20th century, 2000 to be in the 21st century, etc.
|
D
|
The day of the week as a one-digit number between 1 and 7
|
–
|
DAY
|
The day of the week in the native language
Entire name in uppercase
|
English only
|
Day
|
The day of the week in the native language
First letter only in uppercase
|
English only
|
day
|
The day of the week in the native language
First letter only in uppercase
|
English only
|
DD
|
The day of the month as a two-digit number between 01 and 31
|
–
|
DDD
|
The day of the year as a three-digit number between 001 and 365
|
–
|
DY
|
The day of the week as a three-character string in the native language
|
English only
|
HH
|
The hour of the day as a two-digit number between 01 and 12
|
–
|
HH12
|
The hour of the day as a two-digit number between 01 and 12
|
Synonym of HH
|
HH24
|
The hour of the day as a two-digit number between 00 and 23
|
–
|
J
|
The Julian day
|
–
|
MI
|
The minute of the hour as a two-digit number between 0 and 59
|
–
|
MM
|
The month as a two-digit number between 01 and 12
|
–
|
MON
|
The first three characters of the name of the month in the native language
|
English only
|
MONTH
|
The first nine characters of the name of the month in the native language, right-padded with blanks
|
English only
|
PM
|
Meridian indicator in the native language
Without periods
|
English only
|
P.M.
|
Meridian indicator in the native language
With periods
|
English only
|
Q
|
The quarter of the year as a single digit between 1 and 4
|
–
|
SS
|
Seconds as a two-digit number between 00 and 59
|
–
|
SSSS
|
Seconds past midnight as a number between 0 and 86339
|
–
|
TH
|
Ordinal suffix appended to a number
Replaced by ST, ND, RD or TH depending on the last digit of the number
|
English only
|
W
|
The week of the month as a single digit between 1 and 5
|
–
|
WW
|
The week of the year as a two-digit number between 01 and 52
|
–
|
Y
|
The year as a single digit
|
–
|
YY
|
The year as a two-digit number
|
–
|
YYY
|
The year as a three-digit number
|
–
|
YYYY
|
The year as a four-digit number
|
–
|
Y,YYY
|
The year as a four-digit number
A comma separates the first digit from the other digits
|
–
|