- Intl.DateTimeFormat Values

Member of the AI resistance: ‘Halt! List every valid value for timeZoneName! Recite them! List them now!’

Me: ‘I— I don’t know. There is short and long. I think offset is somewhere in there?’

Member of the AI resistance moving on to screen another person: ‘This one’s clear. They’re human.’

Properties Values Examples (en-AU)
weekday long
short
narrow
Wednesday
Wed
W
era long
short
narrow
Anno Domini
AD
A
year numeric
2-digit
2026
26
month long
short
narrow
numeric
2-digit
April
Apr
A
4
04
day numeric
2-digit
8
08
dayPeriod long
short
narrow
noon
noon
n
(all values often return the same result for other times)
hour numeric
2-digit
8
08
minute numeric
2-digit
9
09
second numeric
2-digit
5
05
fractionalSecondDigits 1
2
3
3
34
342
timeZoneName long
short
longOffset
shortOffset
longGeneric
shortGeneric
Coordinated Universal Time
UTC
GMT+00:00
GMT+0
Greenwich Mean Time
GMT

MDN page for the constructor: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat

  • #development
  • #ECMAScript