Datetime Format Elements
A datetime format model is composed of one or more datetime format elements. Table 3-2 shows the datatime format elements. In addition:
-
For input format models, the format elements cannot appear more than once, and format elements that represent similar information cannot be combined. For example, you cannot use the
SYYYY
and theBC
format elements in the same format string. -
For
DATE
format elements, capitalization in a spelled-out word, abbreviation or Roman numeral, follows the capitalization in the corresponding format element. For example, the date format modelDAY
produces capitalized words, likeMONDAY
, whereasDay
producesMonday
, andday
producesmonday
.
Table 3-2 Datetime format elements
Element | Description |
---|---|
|
Punctuation and quoted text are reproduced in the result. |
|
AD indicator with or without periods. |
|
Meridian indicator with or without periods. |
|
BC indicator with or without periods. |
|
Valid in Century:
For example, 2002 returns 21 and 2000 returns 20. |
|
Day of week (1-7). |
|
Name of day, padded with blanks to display width of widest name of day. |
|
Day of month (1-31). |
|
Day of year. |
|
Long date format. In the default Restriction: Specify this format only with the |
|
Short date format In the default Restriction: Specify this format only with the |
|
Abbreviated name of day. |
|
Valid in Fractional seconds. No radix character is printed. Use the |
|
Returns a value with no leading or no trailing blanks. |
|
Returns exact matching between the character data and the format model. |
|
Hour of day (1-12). |
|
Hour of day (0-23). |
|
Valid in Calendar week of year (1-52 or 1-53), as defined by the ISO 8601 standard.
|
|
Valid in 4-digit year of the year containing the calendar week, as defined by the ISO 8601 standard. |
|
Valid in Last 3, 2, or 1 digit(s) of the year containing the calendar week, as defined by the ISO 8601 standard. |
|
Julian day. This is the number of days since January 1, 4712 BC. Numbers specified with |
|
Minute (0-59). |
|
Month (01-12, where January = 01). |
|
Abbreviated name of month. |
|
Name of month padded with blanks to display width of the widest name of month. |
|
Meridian indicator with or without periods. |
|
Valid in Quarter of the year (1, 2, 3, 4). January = 1. |
|
Roman numeral month (I-XII. January = I). |
|
For 20th century dates in the 21st century using only two digits. |
|
Rounded year. Accepts either 4-digit or 2-digit input. If 2-digit, provides the same return as |
|
Second (0-59). |
|
Seconds past midnight (0-86399). |
|
Returns a value in the short time format. Restriction: Specify this format only with the |
|
Valid in Week of year (1-53) where week one starts on the first day of the year and continues to the seventh day of the year. |
|
Valid in Week of month (1-5) where week one starts on the first day of the month and ends on the seventh. |
|
Local radix character For example: 'HH:MI:SSXFF' |
|
Year with comma in this position |
|
Valid in Year, spelled out. |
|
4-digit year.
|
|
Last 3, 2, or 1 digit(s) of year. |