In an output template string (for TO_CHAR
), there are certain patterns that are recognized and replaced with appropriately-formatted data from the value to be formatted. Any text that is not a template pattern is simply copied verbatim. Similarly, in an input template string (for anything other than TO_CHAR
), template patterns identify the parts of the input data string to be looked at and the values to be found there.
Certain modifiers can be applied to any template pattern to alter its behavior as described in Template Pattern Modifiers for Date/Time Formatting.
Pattern |
Description |
|
hour of day (01-12) |
|
hour of day (01-12) |
|
hour of day (00-23) |
|
minute (00-59) |
|
second (00-59) |
|
millisecond (000-999) |
|
microsecond (000000-999999) |
|
seconds past midnight (0-86399) |
|
meridian indicator (uppercase) |
|
meridian indicator (lowercase) |
|
year (4 and more digits) with comma |
|
year (4 and more digits) |
|
last 3 digits of year |
|
last 2 digits of year |
|
last digit of year |
|
ISO year (4 and more digits) |
|
last 3 digits of ISO year |
|
last 2 digits of ISO year |
|
last digits of ISO year |
|
era indicator (uppercase) |
|
era indicator (lowercase) |
|
full uppercase month name (blank-padded to 9 chars) |
|
full mixed-case month name (blank-padded to 9 chars) |
|
full lowercase month name (blank-padded to 9 chars) |
|
abbreviated uppercase month name (3 chars) |
|
abbreviated mixed-case month name (3 chars) |
|
abbreviated lowercase month name (3 chars) |
|
month number (01-12) |
|
full uppercase day name (blank-padded to 9 chars) |
|
full mixed-case day name (blank-padded to 9 chars) |
|
full lowercase day name (blank-padded to 9 chars) |
|
abbreviated uppercase day name (3 chars) |
|
abbreviated mixed-case day name (3 chars) |
|
abbreviated lowercase day name (3 chars) |
|
day of year (001-366) |
|
day of month (01-31) |
|
day of week (1-7; Sunday is 1) |
|
week of month (1-5) (The first week starts on the first day of the month.) |
|
week number of year (1-53) (The first week starts on the first day of the year.) |
|
ISO week number of year (The first Thursday of the new year is in week 1.) |
|
century (2 digits) |
|
Julian Day (days since January 1, 4712 BC) |
|
quarter |
|
month in Roman numerals (I-XII; I=January) (uppercase) |
|
month in Roman numerals (i-xii; i=January) (lowercase) |
|
time-zone name (uppercase) |
|
time-zone name (lowercase) |