Tokens for date/time formatting
Use date/time formatting tokens to change the format of date/time data. For example, you can convert a timestamp to a quarter of the year or day of the week. The following tables present the tokens supported for changes in formatting.
Year, month, and day tokens
Token | Output | Description |
---|---|---|
|
| 2 digit year |
|
| 4 digit year |
|
| Year with any number of digits and sign |
|
| Quarter of year |
|
| Quarter of year with ordinal |
|
| Month number |
|
| Month with ordinal |
|
| Month number with leading zero |
|
| Month abbreviation |
|
| Month name |
|
| Day of month |
|
| Day of month with ordinal |
|
| Day of month with leading zero |
|
| Day of year |
|
| Day of year with ordinal |
|
| Day of year with leading zero |
Week year, week, and weekday tokens
Token | Output | Description |
---|---|---|
|
| Day of week |
|
| Day of week with ordinal |
|
| Day abbreviation |
|
| Day abbreviation |
|
| Day name |
|
| Day of week (ISO) |
|
| Week of year |
|
| Week of year with ordinal |
|
| Week of year with leading zero |
|
| Week of year (ISO) |
|
| Week of year with ordinal (ISO) |
|
| Week of year with leading zero (ISO) |
|
| Week year |
|
| Week year |
|
| Week year (ISO |
|
| Week year (ISO) |
Hour, minute, second, millisecond, and offset tokens
Token | Output | Description |
---|---|---|
|
| 24 hour time |
|
| 24 hour time with leading zero |
|
| 12 hour time |
|
| 12 hour time with leading zero |
|
| 24 hour time |
|
| 24 hour time with leading zero |
|
| Post or ante meridiem (upper case) |
|
| Post or ante meridiem (lower case) |
|
| Minutes |
|
| Minutes with leading zero |
|
| Seconds |
|
| Seconds with leading zero |
|
| Fractional seconds |
|
| Fractional seconds with leading zero |
|
| Fractional seconds with two leading zeros |
|
| Fractional seconds |
|
| Time zone |
|
| Time zone |
|
| Unix Timestamp |
|
| Unix Millisecond Timestamp |