CLDR yyyy
Four-digit year.
2006
at the reference instant, Mon, Jan 2 2006, 3:04:05 PM MST
The calendar year, all digits (2006). CLDR's y grows as needed while yyyy zero-pads to four; most token languages only offer the four-digit form.
| Language | Token | Caveat |
|---|---|---|
| C / POSIX strftime | %Y | No fixed width — just the year as a decimal number. |
| C# custom format | yyyy | |
| CLDR / ICU pattern | y | Minimum digits, so 2026 prints in full; yyyy zero-pads to four. Do not reach for YYYY — that is the week-based year. |
| Go time layout | 2006 | |
| Java DateTimeFormatter | uuuu | Proleptic year — the javadoc's plain 'year'. yyyy is year-of-era: same output on ISO CE dates, different for BCE and other chronologies. Pick one deliberately. |
| JavaScript Intl.DateTimeFormat | year: "numeric" | |
| Moment.js format | YYYY | |
| PHP date() | Y | At least four digits; years BCE get a leading minus sign. |
| Python strftime | %Y | Not zero-padded below year 1000 on all platforms. |
| Ruby strftime | %Y | Zero-padded, includes the century. |
| Rust chrono | %Y | Zero-padded to four digits; proleptic Gregorian, so negative years are possible. |
Definition anchored to Unicode UTS #35 — Date Field Symbol Table.