The following tables describe the date and time format masks, and the suffixes you can add to date format masks:
Date or Time Format Mask |
Explanation |
SCC or CC |
Century, abbreviated; 'S' prefixes "BC" with (-) |
SYYYY or YYYY |
Year; 'S' prefixes "BC" date with a (-) |
I or IY or IYY |
Last 1, 2, or 3 digit(s) of year |
Y or YY or YYY |
Last 1, 2, or 3 digit(s) of year |
Y,YYY |
Year with comma |
SYEAR or YEAR |
Year, spelled out; 'S' prefixes "BC" date with (-) |
RRRR or SRRRR |
Year; 'S' prefixes "BC" date with a (-) |
RR |
Last 2 digit(s) of year |
BC, AD, or B.C., A.D. |
Century indicator |
Q |
Quarter of year (Jan-Mar=Quarter 1) |
MM |
Month in digits (Jan = 01) |
MONTH or MON |
Name of month, or 3-letter abbreviation |
WW, IW |
Week in year |
W |
Week in Julian days |
J |
Julian day; the number of days since January 1,4712 BC |
DDD, DD, or D |
Day in year, month, or week |
DAY |
Day of week fully spelled out (for example, MONDAY) |
DY |
Name of day, 3-letter abbreviation (for example, MON) |
AM, PM, or A.M., P.M. |
Meridian indicator |
HH or HH12 |
Hour of day (1-12) |
HH24 |
Hour of day (0-23) |
MI |
Minute |
SS; SSSSS |
Second in minute; seconds in day |
FM |
Toggles fill mode which replaces multiple spaces before or between dates, numbers, or words with a single space |
The following suffixes may be added to the format masks:
Data Format Mask Suffix |
Explanation |
TH |
Suffixed number ("DDth" for "4th") |
SP |
Spelled out number ("DDSP" for "FOUR") |
SPTH or THSP |
Spelled and suffixed number ("DDSPTH" for "FOURTH") |
Sample Date Format |
Date Displayed |
MM/DD/RR |
03/04/02 |
DD MON RRRR |
04 MAR 2002 |
Mon. DD, RRRR |
Mar. 4, 2002 |
Day Month DD fmHH:MI AM |
Monday March 4 11:35 AM |
Dy Mon ddth fmHH24:MI:SS |
Mon Mar 4th 23:35:22 |
Day "the" ddthsp "of" Month |
Monday the fourth of March |
Applying a format mask to a numeric object
Applying a format mask to a date object
Changing the format mask for multiple fields
Specifying number format masks
Copyright © 1984, 2005, Oracle. All rights reserved.