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.
| Token | Means | Example |
|---|---|---|
| y | Four-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 |
| yy | Two-digit year Exactly the two low-order digits; the only y-count with special meaning. | 06 |
| M | Month number Format-style month; L is the stand-alone form some locales need for nominative month names. | 1 |
| MM | Month number, padded | 01 |
| MMM | Month name, abbreviated MMMMM gives the narrow single-letter form; LLL is the stand-alone variant. | Jan |
| MMMM | Month name, full | January |
| d | Day of month | 2 |
| dd | Day of month, padded | 02 |
| E | Weekday, abbreviated E, EE and EEE are all the abbreviation; EEEEE is narrow, EEEEEE short. e and c add locale-dependent numeric forms. | Mon |
| EEEE | Weekday, full | Monday |
| D | Day of year Minimum digits, so unpadded; DDD zero-pads to three. | 2 |
| w | Week 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 |
| Y | ISO 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 |
| H | Hour, 24-hour clock 0-23; k is the 1-24 variant. | 15 |
| HH | Hour, 24-hour clock, padded | 15 |
| h | Hour, 12-hour clock 1-12; K is the 0-11 variant. | 3 |
| hh | Hour, 12-hour clock, padded | 03 |
| a | AM/PM marker Case follows the locale; b adds noon/midnight and B flexible day periods like "at night". | PM |
| mm | Minute, padded A single m prints minimum digits (unpadded). | 04 |
| ss | Second, padded A single s prints minimum digits (unpadded). Truncated, not rounded. | 05 |
| S | Fractional seconds Prints exactly as many decimal places as you write letters, truncating: SSS is milliseconds, SSSSSS microseconds. | 000 |
| xx | UTC 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 |
| xxx | UTC offset, extended ZZZZZ and XXX are equivalents that print Z at UTC; xxx prints +00:00. | -07:00 |
| z | Time-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 |
| G | Era G through GGG are the abbreviation (AD); GGGG is wide, GGGGG narrow. | AD |
| Q | Quarter 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.