CLDR / ICU pattern tokens.

ICU, Java's DateTimeFormatter, dart intl and Swift's DateFormatter all speak dialects of this

This is the vocabulary everything else on this site maps back to. Every ASCII letter is reserved as a field symbol, and repeating a letter changes width: numeric fields zero-pad to the letter count, name fields step through abbreviated, wide and narrow forms. At heart it is a locale-driven skeleton system — the intended use is to request a skeleton like yMMMd and let CLDR pick the localized pattern, not to hard-code one pattern for every locale. The classic trap is case: YYYY is the week-based year, not the calendar year, and w counts weeks by locale rules, not ISO.

TokenMeansExample
yFour-digit year

Minimum digits, so 2026 prints in full; yyyy zero-pads to four. Do not reach for YYYY — that is the week-based year.

2006
yyTwo-digit year

Exactly the two low-order digits; the only y-count with special meaning.

06
MMonth number

Format-style month; L is the stand-alone form some locales need for nominative month names.

1
MMMonth number, padded01
MMMMonth name, abbreviated

MMMMM gives the narrow single-letter form; LLL is the stand-alone variant.

Jan
MMMMMonth name, fullJanuary
dDay of month2
ddDay of month, padded02
EWeekday, abbreviated

E, EE and EEE are all the abbreviation; EEEEE is narrow, EEEEEE short. e and c add locale-dependent numeric forms.

Mon
EEEEWeekday, fullMonday
DDay of year

Minimum digits, so unpadded; DDD zero-pads to three.

2
wWeek of year

Locale week rules (first day of week plus minimum days in week one), not necessarily ISO; ww zero-pads. Pair it with Y, never y.

1
YISO week-based year

The locale week-based year, which equals the ISO week-year only in ISO-week locales. Writing YYYY where you meant yyyy is the classic silent New-Year bug.

2006
HHour, 24-hour clock

0-23; k is the 1-24 variant.

15
HHHour, 24-hour clock, padded15
hHour, 12-hour clock

1-12; K is the 0-11 variant.

3
hhHour, 12-hour clock, padded03
aAM/PM marker

Case follows the locale; b adds noon/midnight and B flexible day periods like "at night".

PM
mmMinute, padded

A single m prints minimum digits (unpadded).

04
ssSecond, padded

A single s prints minimum digits (unpadded). Truncated, not rounded.

05
SFractional seconds

Prints exactly as many decimal places as you write letters, truncating: SSS is milliseconds, SSSSSS microseconds.

000
xxUTC offset, basic

A single x drops zero minutes (-08); Z through ZZZ print the same basic form. XX prints Z at UTC instead of +0000.

-0700
xxxUTC offset, extended

ZZZZZ and XXX are equivalents that print Z at UTC; xxx prints +00:00.

-07:00
zTime-zone name, short

Short specific non-location name (PDT); zzzz gives the long form. Falls back to a localized GMT format like GMT-8 where no abbreviation exists.

MST
GEra

G through GGG are the abbreviation (AD); GGGG is wide, GGGGG narrow.

AD
QQuarter

QQ pads, QQQ gives Q3, QQQQ 3rd quarter; q is the stand-alone form.

1

Examples render the reference instant, Mon, Jan 2 2006, 3:04:05 PM MST.

Literal text

Wrap literal text in single quotes ('at' in "h 'at' a"); two adjacent single quotes '' produce one literal quote, inside or outside quoted text. Non-letters pass through unquoted, but every ASCII letter needs quoting.

Verified against Unicode UTS #35 — Date Field Symbol Table.

Translate CLDR / ICU pattern