Reference
Reference for strftime and date-fns format tokens.
Runs entirely in your browser
Nothing you paste is uploaded. Monaco and Prettier load on demand from this origin.
Search
| Token | Field | Meaning |
|---|---|---|
| yyyy / %Y | Year | 4-digit year (2026). |
| MM / %m | Month | 2-digit month (01-12). |
| dd / %d | Day | 2-digit day of month. |
| HH / %H | Hour 24 | 24-hour hour (00-23). |
| hh / %I | Hour 12 | 12-hour hour (01-12). |
| mm / %M | Minute | Minutes (00-59). |
| ss / %S | Second | Seconds (00-59). |
| EEE / %a | Weekday | Abbreviated day name. |
| a / %p | AM/PM | Meridiem. |
| ZZ / %z | Offset | Timezone offset (+0000). |
There is no upload endpoint — your files are processed in this browser tab. Open your network tab and check. See how it stays private.
How to date format tokens
- Find a token. Search for the piece of a date you want to format.
- Read the token. See the token and an example of its output.
- Build the pattern. Assemble your format string.
Every date library uses slightly different format tokens, and the case-sensitive ones (month vs minute) cause subtle bugs. A reference with examples makes building or translating a format string quick and correct.
To convert actual timestamps rather than formats, use the Unix timestamp converter.
Frequently asked questions
What token gives a 4-digit year?
YYYY in Moment/day.js patterns and %Y in strftime. The reference lists the equivalents so you can translate a format between systems.
Why do 'MM' and 'mm' differ?
Case matters: MM is usually month, mm is minutes. Mixing them is a classic bug the reference helps you avoid.
Is anything fetched?
No. Everything is built in, so it works without a connection.