Date & Time Tools
Date Format Token Translator
Translate a date format between strftime, Moment, Day.js, Luxon, Java, .NET, ICU, Go, and PHP. Live preview and a token cheat sheet, all in your browser.
Used by C, Python, Ruby, and PHP strftime.
Preview date
Used to render the live output below. Defaults to a date that exercises every token (PM hour, May for short/long months).
strftime preview
2026-05-04 15:30:45
Detected tokens (6)
Each chip is one date or time field the format will substitute. Unrecognised characters are kept as literals.
strftime (source)
strftime (C / Python / Ruby)
Rendered date:
2026-05-04 15:30:45
PHP date
PHP date()
Rendered date:
2026-05-04 15:30:45
Moment
Moment.js / Day.js
Rendered date:
2026-05-04 15:30:45
Luxon
Luxon
Rendered date:
2026-05-04 15:30:45
Java
Java SimpleDateFormat
Rendered date:
2026-05-04 15:30:45
.NET
.NET custom format
Rendered date:
2026-05-04 15:30:45
ICU
ICU / Unicode CLDR
Rendered date:
2026-05-04 15:30:45
Go
Go reference time
Rendered date:
2026-05-04 15:30:45
Token cheat sheet
The same date field in every supported format system. Use this when you only need one or two tokens and want to skip the input above.
| Field | strftime | PHP date | Moment | Luxon | Java | .NET | ICU | Go |
|---|---|---|---|---|---|---|---|---|
| 4-digit year (2026) | %Y | Y | YYYY | yyyy | yyyy | yyyy | yyyy | 2006 |
| 2-digit year (26) | %y | y | YY | yy | yy | yy | yy | 06 |
| Month 1-12 | %-m | n | M | L | M | M | M | 1 |
| Month 01-12 | %m | m | MM | LL | MM | MM | MM | 01 |
| Month name short (Jan) | %b | M | MMM | LLL | MMM | MMM | MMM | Jan |
| Month name long (January) | %B | F | MMMM | LLLL | MMMM | MMMM | MMMM | January |
| Day of month 1-31 | %-d | j | Do | d | d | d | d | _2 |
| Day of month 01-31 | %d | d | DD | dd | dd | dd | dd | 02 |
| Weekday short (Mon) | %a | D | ddd | EEE | EEE | ddd | EEE | Mon |
| Weekday long (Monday) | %A | l | dddd | EEEE | EEEE | dddd | EEEE | Monday |
| Weekday 0-6 (Sun=0) | %w | w | d | - | - | - | - | - |
| Weekday 1-7 (Mon=1) | %u | N | E | E | u | - | e | - |
| Day of year 001-366 | %j | z | DDDD | ooo | DDD | - | DDD | 002 |
| ISO week of year 01-53 | %V | W | WW | WW | ww | - | ww | - |
| Hour 0-23 | %-H | G | H | H | H | H | H | - |
| Hour 00-23 | %H | H | HH | HH | HH | HH | HH | 15 |
| Hour 1-12 | %-I | g | h | h | h | h | h | 3 |
| Hour 01-12 | %I | h | hh | hh | hh | hh | hh | 03 |
| Minute 0-59 | %-M | - | m | m | m | m | m | 4 |
| Minute 00-59 | %M | i | mm | mm | mm | mm | mm | 04 |
| Second 0-59 | %-S | - | s | s | s | s | s | 5 |
| Second 00-59 | %S | s | ss | ss | ss | ss | ss | 05 |
| Milliseconds 000-999 | %f | v | SSS | SSS | SSS | fff | SSS | .000 |
| AM / PM | %p | A | A | a | a | tt | a | PM |
| am / pm | %P | a | a | - | - | - | - | pm |
| Offset ±HHMM | %z | O | ZZ | ZZZ | Z | zz | ZZZ | -0700 |
| Offset ±HH:MM | %:z | P | Z | ZZ | XXX | zzz | xxx | -07:00 |
| Time zone abbreviation | %Z | T | - | ZZZZ | zzzz | - | ZZZZ | MST |
| Unix timestamp seconds | %s | U | X | X | - | - | - | - |
| Unix timestamp milliseconds | - | - | x | x | - | - | - | - |
| ISO 8601 datetime | - | c | - | - | - | - | - | - |
How to use
- Type or paste your date format string into the Source format box. The placeholder shows a typical example for the currently selected token system.
- Pick the system the format is written in (strftime, PHP date, Moment, Luxon, Java, .NET, ICU, or Go). The detected tokens panel labels each field, so you can verify the parse before reading the translations.
- Adjust the Preview date if you want to see how the format renders against a specific instant. Toggle Local time and UTC to compare offsets and abbreviations.
- Read the translation grid for the equivalent format in every supported system. Each card has Copy format and Use as source buttons, so you can switch the source language without retyping anything.
- Use the Token cheat sheet at the bottom of the page when you only need one or two tokens. Each row of the table shows the same date field in every supported format system, side by side.
About this tool
Date Format Token Translator rewrites a date or time format string between the token systems used by different programming languages and libraries: strftime (used by C, Python, Ruby, and PHP strftime), PHP date()/DateTime::format(), Moment.js and Day.js, Luxon, Java SimpleDateFormat and DateTimeFormatter, .NET custom date and time format strings, ICU and Unicode CLDR (the patterns Intl.DateTimeFormat speaks under the hood), and Go's reference-time format. Paste a format you already have, pick the system it came from, and the tool parses every token, displays each field as a labelled chip, and emits the equivalent format in every other system at the same time. A user-pickable preview date renders the format against a real instant so you can sanity check what the format actually produces before you ship it; Local and UTC modes are both supported, and the tool surfaces the resolved IANA time zone of your browser so the offset and abbreviation are clear. Literal segments are escaped automatically with each system's own convention (Moment uses [square brackets], Java/.NET/ICU/Luxon use 'single quotes', PHP date() uses backslash escapes, Go has no formal escape) so a round trip through the translator does not break punctuation, separators, or words that look like tokens. Seven common preset formats are included (ISO 8601 date-time, ISO 8601 date only, US slash, EU dotted, long human, filename safe, and RFC 3339 with offset) and a full token cheat sheet at the bottom of the page lays out every supported date field next to its preferred token in every system, so you can grab one or two tokens without going through the input box at all. Useful when porting a logger from Python to a Java service, building a date-picker that accepts the same shape your backend writes, copying a Moment.js dashboard format into Grafana's Go-based formatter, asking an LLM for a date format and translating its strftime answer to Java, or just confirming what '%Y-%m-%dT%H:%M:%S' means in C# without leaving your editor. Parsing and rendering run entirely in your browser; the format string and the preview date never leave the page.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Date Format Converter
Re-format any date string into ISO, US, EU, RFC 2822, Unix, or a custom token pattern.
Open tool
Date & TimeUnix Timestamp Converter
Convert epoch timestamps to dates and back.
Open tool
Date & TimeTime Format Converter
Convert 12-hour AM/PM and 24-hour military time, single value or batch.
Open tool
Date & TimeISO 8601 Duration Converter
Two-way ISO 8601 duration parser and builder with seconds, milliseconds, and clock formats.
Open tool
Date & TimeDiscord Timestamp Generator
Build Discord <t:UNIX:STYLE> tokens with live, locale-aware previews.
Open tool