Skip to content
gohacks.dev
Standard Library

Date Format String Converter

Translate a date format string between PHP date(), strftime, MySQL DATE_FORMAT, Moment and Day.js, Unicode patterns (date-fns, Java, ICU) and Go layouts, with a live preview.

Free · No sign-up · Your inputs stay in your browser

Input

Translate date format strings between languages

Output

Tuesday, 27th October 2026 at 2:05pm

LanguageFormat
PHP date() / Carbon format()l, jS F Y \a\t g:ia
strftime (C, Python, Ruby)%A, %-d{suffix} %B %Y at %-I:%M{a}no token for: suffix, a
MySQL DATE_FORMAT%W, %e{suffix} %M %Y at %l:%i{a}no token for: suffix, a
Moment / Day.js / Carbon isoFormatdddd, D{suffix} MMMM YYYY[ at ]h:mmano token for: suffix
Unicode (date-fns, Java, Intl, ICU)EEEE, d{suffix} MMMM yyyy' at 'h:mm{a}no token for: suffix, a
Go time layoutMonday, 2{suffix} January 2006 at 3:04pmno token for: suffix

The preview uses the page date at 14:05:09.042 UTC. Watch the traps this table exists for: m is month in PHP and minutes elsewhere (i in PHP, mm in Moment), Moment's DD is day of month while Unicode's DD is day of year, and YYYY in Unicode patterns is the week-based year, so yyyy is the one you want. PHP's z (day of year) counts from 0, so it is not offered as an equivalent.

Runs in this browser. Nothing you paste is sent to a server.

The same letters mean different things

In PHP m is the month and i the minutes; in Moment mm is minutes and MM the month. Moment's DD is the day of the month, while in Unicode patterns DD is the day of the year. Unicode's YYYY is the week-numbering year, which differs from the calendar year in the last days of December, so yyyy is the one you want. The patterns are defined in Unicode TR35; PHP's letters are in the DateTimeInterface::format reference.

Go's reference time

Go has no letters: a layout is the reference time Mon Jan 2 15:04:05 MST 2006 written the way you want dates to look, so 2006-01-02 means year-month-day.

Share

Frequently asked questions

What is the PHP date format for ISO 8601?
Y-m-d\TH:i:sP, or the constant DATE_ATOM. The c format character produces the same thing.
Why does my date-fns format show the wrong year in late December?
YYYY is the ISO week-numbering year. Use yyyy for the calendar year.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools