Date Format Cheatsheet
Rows
18
tokens
Systems
4
strftime · moment · luxon · Intl
Coverage
common
everyday
Mode
reference
static
input · how to read
Layout
Each row shows the same date part across four formatting systems. Pick the column for your stack.
Tip
If you're migrating from Moment to Luxon, just walk down those two columns.
output · token table
| Example | strftime | Moment.js | Luxon | Intl.DateTimeFormat |
|---|---|---|---|---|
| 2024 | %Y | YYYY | yyyy | numeric (year) |
| 24 | %y | YY | yy | 2-digit (year) |
| January | %B | MMMM | MMMM | long (month) |
| Jan | %b | MMM | MMM | short (month) |
| 01 | %m | MM | MM | 2-digit (month) |
| 1 | %-m | M | M | numeric (month) |
| 07 | %d | DD | dd | 2-digit (day) |
| 7 | %-d | D | d | numeric (day) |
| Monday | %A | dddd | EEEE | long (weekday) |
| Mon | %a | ddd | EEE | short (weekday) |
| 14 | %H | HH | HH | 2-digit (hour 24h) |
| 2 | %-I | h | h | numeric (hour 12h) |
| 05 | %M | mm | mm | 2-digit (minute) |
| 30 | %S | ss | ss | 2-digit (second) |
| PM | %p | A | a | long/short (dayPeriod) |
| 001-366 | %j | DDDD | ooo | — |
| +0500 | %z | ZZ | ZZZ | shortOffset |
| EST | %Z | z | ZZZZ | short (timezone) |