0

Date and time formats

Token Description Example
YY Year: 2 digits 21
YYYY Year: 4 digits 2021
M Month: 1 or 2 digits 1 … 12
Mo Month: ordinal 1st … 12th
MM Month: 2 digits 01 … 12
MMM Month: 3 characters Feb
MMMM Month: full name February
D Day: 1 or 2 digits 1 … 31
Do Day: 1 or 2 digits, ordinal 1st … 31st
DD Day: 2 digits 01 … 31
d Day: in a week as number (0-6) 0 … 6
do Day: ordinal in week 0th … 6th
dd Weekday: 2 characters Mo … Su
ddd Weekday: 3 characters Mon … Sun
dddd Weekday: full name Friday
w or W Year: calendar week 1 … 53
Q Year: quarter 1 … 4
l Lowercase "L" - M/D/YYYY 6/15/2021
L Uppercase "L" - MM/DD/YYYY 06/15/2021
h Hour: 1 or 2 digits (12 h) 1 … 12
hh Hour: 2 digits (12 h) 01 … 12
H Hour: 1 or 2 digits (24 h) 0 … 23
HH Hour: 2 digits (24 h) 00 … 23
a Hour: am or pm hh:mm a = 11:30 pm (23:30)
m Minute: 1 or 2 digits 0 … 59
mm Minute: 2 digits 00 … 59
s Second: 1 or 2 digits 0 … 59
ss Second: 2 digits 00 … 59
x Unix time: in milliseconds April 8, 2021 - 9:11:58 GMT = 1617873118285
X Unix time April 8, 2021 - 9:11:58 GMT = 1617873118
Z Time zone offset from UTC -04:00:00

3 replies

null
    • Anton
    • 3 wk ago
    • Reported - view

    Would be helpful to have a link here to a place that says how to use these.
    I found this page by search - these are indeed the components I want to use but I still have no idea how to access them or where to look to find out. ☹️

      • Fred
      • 3 wk ago
      • Reported - view

       Yeah, their instructions have been a work in progress since forever. You use the format() command.

      • Anton
      • 3 wk ago
      • Reported - view

      Perfect. Thank you!