Zero Signup ToolsFree browser tools

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.

Quick presets:

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.

4-digit year (2026)"-"Month 01-12"-"Day of month 01-31" "Hour 00-23":"Minute 00-59":"Second 00-59

strftime (source)

strftime (C / Python / Ruby)

%Y-%m-%d %H:%M:%S

Rendered date:

2026-05-04 15:30:45

PHP date

PHP date()

Y-m-d H:i:s

Rendered date:

2026-05-04 15:30:45

Moment

Moment.js / Day.js

YYYY[-]MM[-]DD[ ]HH[:]mm[:]ss

Rendered date:

2026-05-04 15:30:45

Luxon

Luxon

yyyy'-'LL'-'dd' 'HH':'mm':'ss

Rendered date:

2026-05-04 15:30:45

Java

Java SimpleDateFormat

yyyy'-'MM'-'dd' 'HH':'mm':'ss

Rendered date:

2026-05-04 15:30:45

.NET

.NET custom format

yyyy'-'MM'-'dd' 'HH':'mm':'ss

Rendered date:

2026-05-04 15:30:45

ICU

ICU / Unicode CLDR

yyyy'-'MM'-'dd' 'HH':'mm':'ss

Rendered date:

2026-05-04 15:30:45

Go

Go reference time

2006-01-02 15:04:05

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.

FieldstrftimePHP dateMomentLuxonJava.NETICUGo
4-digit year (2026)%YYYYYYyyyyyyyyyyyyyyyy2006
2-digit year (26)%yyYYyyyyyyyy06
Month 1-12%-mnMLMMM1
Month 01-12%mmMMLLMMMMMM01
Month name short (Jan)%bMMMMLLLMMMMMMMMMJan
Month name long (January)%BFMMMMLLLLMMMMMMMMMMMMJanuary
Day of month 1-31%-djDodddd_2
Day of month 01-31%ddDDdddddddd02
Weekday short (Mon)%aDdddEEEEEEdddEEEMon
Weekday long (Monday)%AlddddEEEEEEEEddddEEEEMonday
Weekday 0-6 (Sun=0)%wwd-----
Weekday 1-7 (Mon=1)%uNEEu-e-
Day of year 001-366%jzDDDDoooDDD-DDD002
ISO week of year 01-53%VWWWWWww-ww-
Hour 0-23%-HGHHHHH-
Hour 00-23%HHHHHHHHHHHH15
Hour 1-12%-Ighhhhh3
Hour 01-12%Ihhhhhhhhhhh03
Minute 0-59%-M-mmmmm4
Minute 00-59%Mimmmmmmmmmm04
Second 0-59%-S-sssss5
Second 00-59%Ssssssssssss05
Milliseconds 000-999%fvSSSSSSSSSfffSSS.000
AM / PM%pAAaattaPM
am / pm%Paa----pm
Offset ±HHMM%zOZZZZZZzzZZZ-0700
Offset ±HH:MM%:zPZZZXXXzzzxxx-07:00
Time zone abbreviation%ZT-ZZZZzzzz-ZZZZMST
Unix timestamp seconds%sUXX----
Unix timestamp milliseconds--xx----
ISO 8601 datetime-c------

How to use

  1. Type or paste your date format string into the Source format box. The placeholder shows a typical example for the currently selected token system.
  2. 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.
  3. 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.
  4. 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.
  5. 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

All tools
All toolsDate & Time Tools