Skip to Content
ReferenceToken Mapping

Token Mapping

This table shows how each dialect spells every canonical field. Each row is one canonical field, and each column is a dialect. For a dialect’s full grammar, literals, aliases, and caveats, see its page under Dialects.

An em dash means the dialect has no token for that field. Converting that field into the dialect has no clean target, so it is routed through onUnsupportedToken (default: escaped as a literal). Each new dialect adds one column rather than a pairwise table.

Behaviour specific to a concrete tool (e.g. extensions, unrenderable tokens, option-gated tokens) lives in Libraries; the tokens below are the dialect grammars themselves.

Era & year

Meaningmomentldmlstrftime
Era, abbreviatedNGGG—
Era, wideNNNNGGGG—
Era, narrowNNNNNGGGGG—
Calendar yearYYYYyyyy%Y
Calendar year, 2-digitYYyy%y
Century, 2-digit——%C
Local week-numbering yearggggYYYY—
Local week-numbering year, 2-digitggYY—
ISO week-numbering yearGGGG—%G
ISO week-numbering year, 2-digitGG—%g

Month & quarter

Meaningmomentldmlstrftime
QuarterQQ—
Quarter, 2-digit—QQ—
Quarter, ordinalQo——
Quarter, abbreviated—QQQ—
Quarter, wide—QQQQ—
Quarter, narrow—QQQQQ—
Quarter, abbreviated, stand-alone—qqq—
Quarter, wide, stand-alone—qqqq—
Quarter, narrow, stand-alone—qqqqq—
MonthMM%-m
Month, 2-digitMMMM%m
Month, space-padded——%_m
Month, ordinalMo——
Month, abbreviatedMMMMMM%b
Month, wideMMMMMMMM%B
Month, narrow—MMMMM—
Month, abbreviated, stand-alone—LLL—
Month, wide, stand-alone—LLLL—
Month, narrow, stand-alone—LLLLL—

Week & day

Meaningmomentldmlstrftime
Local week of yearww—
Local week of year, 2-digitwwww—
Local week of year, ordinalwo——
ISO week of yearW—%-V
ISO week of year, 2-digitWW—%V
ISO week of year, space-padded——%_V
ISO week of year, ordinalWo——
Day of monthDd%-d
Day of month, 2-digitDDdd%d
Day of month, space-padded——%e
Day of month, ordinalDo——
Day of yearDDDD%-j
Day of year, 2-digit—DD—
Day of year, 3-digitDDDDDDD%j
Day of year, space-padded——%_j
Day of year, ordinalDDDo——

Weekday

Meaningmomentldmlstrftime
Weekday, abbreviateddddEEE%a
Weekday, wideddddEEEE%A
Weekday, narrow—EEEEE—
Weekday, shortddEEEEEE—
Weekday, abbreviated, stand-alone—ccc—
Weekday, wide, stand-alone—cccc—
Weekday, narrow, stand-alone—ccccc—
Weekday, short, stand-alone—cccccc—
Weekday, number (locale)de%w
Weekday, number (locale), 2-digit—ee—
Weekday, number (ISO)E—%u

Day period & time

Meaningmomentldmlstrftime
AM/PMAa%p
AM/PM, lowercasea—%P
AM/PM, wide—aaaa—
AM/PM, narrow—aaaaa—
Day period + noon/midnight—b—
Day period + noon/midnight, wide—bbbb—
Day period + noon/midnight, narrow—bbbbb—
Flexible day period—B—
Flexible day period, wide—BBBB—
Flexible day period, narrow—BBBBB—
Hour 1–12hh%-I
Hour 1–12, 2-digithhhh%I
Hour 1–12, space-padded——%l
Hour 0–23HH%-H
Hour 0–23, 2-digitHHHH%H
Hour 0–23, space-padded——%k
Hour 1–24kk—
Hour 1–24, 2-digitkkkk—
Hour 0–11—K—
Hour 0–11, 2-digit—KK—
Minutemm%-M
Minute, 2-digitmmmm%M
Minute, space-padded——%_M
Secondss%-S
Second, 2-digitssss%S
Second, space-padded——%_S
Fractional second (1–3 digits)S SS SSSS SS SSS—

Time zone & epoch

Meaningmomentldmlstrftime
Time-zone namezzzz%Z
Offset, ±hh:mmZxxx—
Offset, ±hhmmZZxx%z
Offset, ±hh:mm, Z at zero—XXX—
Offset, ±hhmm, Z at zero—XX—
Unix timestamp, secondsX—%s
Unix timestamp, millisecondsx——

The ldml dialect itself defines no Unix-epoch tokens, ISO week fields, or ordinals. Libraries can add them; for example, date-fns adds t and T for the epoch. A dialect → dialect conversion literalizes those fields. See Libraries.

Localized presets

These render per the library’s loaded locale and map preset → preset. Not every dialect defines them: where a column shows — here, the presets are supplied by a library layered on that dialect (e.g. dateFns over ldml), not by the bare dialect itself. See Libraries → Localized presets.

Meaningmomentldmlstrftime
Date, shortL—%x
Date, mediumll——
Date, longLL——
Time, shortLT——
Time, with secondsLTS—%X
Date + time, mediumlll——
Date + time, longLLL——
Date + time, fullLLLL—%c

Aliases & caveats

Each dialect page documents its extra spellings and grammar-specific quirks such as numbering and casing:

Last updated on