MM |
Month (01-12; JAN = 01). |
Y |
Y |
YYYY |
Four-digit year. |
Y |
Y |
YYY |
Last three digits of year. |
Y |
Y |
YY |
Last two digits of year. |
Y |
Y |
Y |
Last digit of year. |
Y |
Y |
Q |
Quarter of year (1, 2, 3, 4; JAN-MAR = 1). |
N |
Y |
MON |
Abbreviated name of month (JAN, FEB, ..., DEC). |
Y |
Y |
MONTH |
Name of month, padded with blanks to nine characters (JANUARY, FEBRUARY, ..., DECEMBER). |
Y |
Y |
RM |
Roman numeral month (1-XII; JAN = I). |
Y |
Y |
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. |
N |
Y |
W |
Week of month (1-5), where week 1 starts on the first day of the month and continues to the seventh day of the month. |
N |
Y |
D |
Day of week (1-7; SUNDAY = 1). |
N |
Y |
DD |
Day of month (1-31). |
Y |
Y |
DDD |
Day of year (1-366). |
N |
Y |
DAY |
Name of day (SUNDAY, MONDAY, ..., SATURDAY). |
Y |
Y |
DY |
Abbreviated name of day (SUN, MON, ..., SAT). |
Y |
Y |
HH |
Hour of day (1-12). |
Y |
Y |
HH12 |
Hour of day (1-12). |
Y |
Y |
HH24 |
Hour of day (0-23). |
Y |
Y |
AM |
Meridian indicator (AM/PM). |
Y |
Y |
PM |
Meridian indicator (AM/PM). |
Y |
Y |
MI |
Minute (0-59). |
Y |
Y |
SS |
Second (0-59). |
Y |
Y |
SSSSS |
Seconds past midnight (0-86399). |
Y |
Y |
SE |
Seconds since epoch (January 1, 1970 UTC). This format can only be used by itself, with the FF format, and/or with the time zone codes TZD, TZR, TZH and TZM.
|
Y |
Y |
MIC |
Microseconds since epoch (January 1, 1970 UTC).
|
Y |
Y |
FF |
Fractions of seconds (0-999999). When used in output, FF produces six digits for microseconds. FFFF produces twelve digits, repeating the six digits for microseconds twice. (In most circumstances, this is not the desired effect.) When used in input, FF collects all digits until a non-digit is detected, and then uses only the first six, discarding the rest.
|
Y |
Y |
FF[1-9] |
Fractions of seconds. For output only, produces the specified number of digits, rounding or padding with trailing zeros as needed.
|
N |
Y |
MS |
Milliseconds since epoch (January 1, 1970 UTC). When used for input, this format code can only be combined with FF (microseconds) and the time zone codes TZD, TZR, TZH, TZM. All other format code combinations generate errors. Furthermore, when MS is used with FF, the MS code must precede the FF code: for example, MS.FF.
|
Y |
Y |
FM |
Fill mode toggle: suppress zeros and blanks or not (default: not).
|
Y |
Y |
FX |
Exact mode toggle: match case and punctuations exactly (default: not).
|
Y |
Y |
RR |
Lets you store 20th century dates in the 21st century using only two digits.
|
Y |
N |
RRRR |
Round year. Accepts either four-digit or two-digit input. If two-digit, provides the same return as RR.
|
Y |
N |
TZD |
Abbreviated time zone designator such as PST.
|
Y |
Y |
TZH |
Time zone hour displacement. For example, -5 indicates a time zone five hours earlier than GMT.
|
N |
Y |
TZM |
Time zone hour and minute displacement. For example, -5:30 indicates a time zone that is five hours and 30 minutes earlier than GMT.
|
N |
Y |
TZR |
Time zone region name. For example, US/Pacific for PST.
|
N |
Y |