René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

datetime format elements [Oracle]

Datetime format elements are used in nls_date_format, to_date and to_char.
AD AD or BC
A.D. A.D. or B.C.
AM Meridian indicator (AM or PM)
A.M. Meridian indicator (A.M. or P.M.)
BC AD or BC
B.C. A.D. or B.C.
CC century
SCC century with leading space
D day of week (between 1 and 7)
DAY spelled name of day (char(9))
DD day of month (between 1 and 31)
DDD day of year (between 1 and 366)
DL long date format (eg: Saturday, December 30, 2006)
DS short date format (eg: 12/30/2006)
DY abbreviated name of day (char(3))
E abbreviated name of era
EE name of era
FFx x=1 through 9 (6?): fraction of seconds
FM no leading or trailing blanks
FX requires exact matching between character string and format
HH hour of the day (between 1 and 12)
HH12 hour of the day (between 1 and 12)
HH24hour of the day (between 1 and 24)
IW week of the year (between 1 and 52/53)
IYYY 4 digit ISO year
IYY last three digits of ISO year
IY last two digits of ISO year
I last digit of ISO year
J julian day (numbers of days since 1st of January 4712 B.C)
MIminute (between 0 and 59)
MM month (between 1 and 12)
MONTHname of month (char(9))
MON abbreviated name of month (char(3))
PM PM indicator
P.M. P.M. indicator
Q quarter of year
RM roman month (I .. XII)
RR two digit years
RRRR ???
SSSeconds (0-59)
SSSSSseconds since midnight, see this example
TS short time formattd>
TZD daylight saving information
TZH timezone hour
TZM Time zone minute
TZR ???
WW week of year (first week days 1 through 7 in year)
W week of month (first week days 1 through 7 in month)
X local radix character (???)
Y,YYYyear with comma (wondering who uses that...)
YEAR year spelled
SYEARyear spelled, BC dates prefixed with -
YYYY four digit year
SYYYYfour digit year, BC dates prefixed with -
YYY last three digits of year
YY last two digits of year
Y last digit of year