Date Format Converter
Convert between date format syntaxes: strftime, Moment.js, ICU, Go, PHP, Java.
Reference table
| Element | strftime | Moment | ICU | Go |
|---|---|---|---|---|
| 4-digit year | %Y | YYYY | yyyy | 2006 |
| 2-digit year | %y | YY | yy | 06 |
| Month (01-12) | %m | MM | MM | 01 |
| Full month name | %B | MMMM | MMMM | January |
| Abbreviated month name | %b | MMM | MMM | Jan |
| Day of month (01-31) | %d | DD | dd | 02 |
| Day of month, no leading zero | %e | D | d | 2 |
| Hour 24h (00-23) | %H | HH | HH | 15 |
| Hour 12h (01-12) | %I | hh | hh | 03 |
| Minute (00-59) | %M | mm | mm | 04 |
| Second (00-59) | %S | ss | ss | 05 |
| AM/PM | %p | A | a | PM |
| Timezone abbreviation | %Z | z | zzz | MST |
| Timezone offset | %z | ZZ | Z | -0700 |
| Full weekday name | %A | dddd | EEEE | Monday |
| Abbreviated weekday name | %a | ddd | EEE | Mon |
| Day of year (001-366) | %j | DDDD | D | __2 |
What it's for
Date format converter for developers
All languages
Supports strftime, Moment.js, Day.js, ICU, Go, PHP, Java, .NET, Ruby.
100% private
Conversion happens in your browser. No data is sent to any server.
Real preview
See how the date would render with your format in each language.
Instant
Real-time conversion as you type. No signup, no waiting.
How it works
Three steps, no hassle
Enter the format token
Type a date format like %Y-%m-%d (strftime) or YYYY-MM-DD (Moment.js). The tool auto-detects the dialect.
Instant conversion
Get the equivalent format in all supported dialects: strftime, Moment.js, ICU, Go, PHP, Java, .NET.
Preview with real date
See how the current date would look with that format in each language.
FAQ
Got questions?
strftime ('string format time') is a function from the C standard library defined in the C89/ANSI C standard. It formats a tm structure (time) as a text string using tokens like %Y (4-digit year), %m (month), %d (day), %H (24h hour), %M (minutes), %S (seconds). It is the origin of almost all date formatting systems: Python, Ruby, PHP (date() uses different tokens but strftime() uses the same), bash, and many more.
Moment.js popularized a different notation: YYYY (4-digit year), MM (month), DD (day), HH (24h hour), mm (minutes), ss (seconds). Key difference: case matters (MM is month, mm is minutes). This notation was adopted by Day.js, date-fns, Luxon and most modern JavaScript libraries. The JavaScript Temporal proposal (TC39) uses ICU notation.
ICU (International Components for Unicode) defines the CLDR standard for date formats. It uses tokens like yyyy (year), MM (month), dd (day), HH (hour). This is the system used in Java (java.time.format.DateTimeFormatter), Swift (DateFormatter), Kotlin, Android, and the JavaScript Temporal proposal. The advantage of ICU is that it also handles localization: the pattern 'd MMMM yyyy' produces 'April 7, 2026' in English and '7 de abril de 2026' in Spanish.
Go (Golang) uses a specific reference date as a template: January 2, 2006 at 15:04:05 on Monday (which corresponds to 01/02 03:04:05PM '06 -0700 MST, an easy-to-remember sequence). Instead of abstract tokens, you describe the format by showing how that specific date would look: '2006-01-02' for year-month-day, '15:04:05' for full time. This approach is unique and more intuitive according to its creators, though confusing at first.
ISO 8601 date: strftime: %Y-%m-%d, Moment.js: YYYY-MM-DD, Go: 2006-01-02, Java: yyyy-MM-dd. Full datetime: strftime: %Y-%m-%dT%H:%M:%S, Moment.js: YYYY-MM-DDTHH:mm:ss, Go: 2006-01-02T15:04:05, Java: yyyy-MM-dd'T'HH:mm:ss. European format: strftime: %d/%m/%Y, Moment.js: DD/MM/YYYY, Go: 02/01/2006, Java: dd/MM/yyyy.
History of date formatting in programming, ISO 8601, locale-aware formatting, timezone handling
Standardizing date formats in computing has historically been problematic. The strftime function was introduced in the C standard library (ANSI C, 1989) but its roots go back to AT&T Unix systems of the 1970s. Before standardization, every system and language used its own notation, causing serious incompatibilities. The ISO 8601 standard (first edition 1988, revised in 2004 and 2019) established YYYY-MM-DD as the universal format for data interchange, adopted by XML, JSON, HTTP (for cookie and header dates), and most modern APIs.
Date localization adds another layer of complexity. The day/month/year order varies by country: DD/MM/YYYY in Europe and Latin America, MM/DD/YYYY in the United States (causing frequent confusion: 01/02/2026 is February 1st in Europe but January 2nd in the US). ICU/CLDR systems handle these differences automatically: the same format function produces 'April 7, 2026' in English, '7 de abril de 2026' in Spanish, '7. April 2026' in German, or '2026年4月7日' in Japanese, without the developer having to manage the differences manually.
Time zones are the most complex part of date handling in software. The IANA Time Zone Database (also called Olson Database or tzdata) maintains the historical and up-to-date record of all time zones in the world, including historical DST (Daylight Saving Time) changes. Many famous software bugs are date-related: the Y2K bug (year 2000), the Year 2038 bug in 32-bit Unix systems (where the Unix timestamp will overflow on January 19, 2038), and DST errors that affect calendars and booking systems twice a year.