Skip to Content
ReferenceToken Mapping

Token Mapping

This is the grammar layer — how each dialect spells every canonical field. Each row is one canonical field; each column is a dialect. This is the side-by-side comparison view; for one dialect’s full grammar, literals, aliases, and caveats, see its page under Dialects.

A 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). Adding a dialect adds a column — no row is pairwise.

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-digitQQ
Quarter, ordinalQo
Quarter, abbreviatedQQQ
Quarter, wideQQQQ
Quarter, narrowQQQQQ
Quarter, abbreviated, stand-aloneqqq
Quarter, wide, stand-aloneqqqq
Quarter, narrow, stand-aloneqqqqq
MonthMM%-m
Month, 2-digitMMMM%m
Month, space-padded%_m
Month, ordinalMo
Month, abbreviatedMMMMMM%b
Month, wideMMMMMMMM%B
Month, narrowMMMMM
Month, abbreviated, stand-aloneLLL
Month, wide, stand-aloneLLLL
Month, narrow, stand-aloneLLLLL

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-digitDD
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, narrowEEEEE
Weekday, shortddEEEEEE
Weekday, abbreviated, stand-aloneccc
Weekday, wide, stand-alonecccc
Weekday, narrow, stand-aloneccccc
Weekday, short, stand-alonecccccc
Weekday, number (locale)de%w
Weekday, number (locale), 2-digitee
Weekday, number (ISO)E%u

Day period & time

Meaningmomentldmlstrftime
AM/PMAa%p
AM/PM, lowercasea%P
AM/PM, wideaaaa
AM/PM, narrowaaaaa
Day period + noon/midnightb
Day period + noon/midnight, widebbbb
Day period + noon/midnight, narrowbbbbb
Flexible day periodB
Flexible day period, wideBBBB
Flexible day period, narrowBBBBB
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–11K
Hour 0–11, 2-digitKK
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 zeroXXX
Offset, ±hhmm, Z at zeroXX
Unix timestamp, secondsX%s
Unix timestamp, millisecondsx

The ldml dialect itself defines no Unix-epoch tokens, ISO week fields, or ordinals — those are library extensions (e.g. date-fns adds t / T for the epoch), not part of the bare dialect, so a dialect → dialect conversion literalizes them. 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

Extra spellings that parse but normalize to a primary token, plus dialect-specific quirks (numbering, casing), are documented per dialect — they are properties of one grammar, not of a pair:

Last updated on