Utilumo
LightDarkSystem

Updated June 29, 2026

Date format tokens reference

Different ecosystems use different format tokens to turn a date into a string. This sheet covers the classic strftime tokens and the Unicode (LDML) tokens used by JavaScript libraries like date-fns and Day.js.

strftime (Python, C, PHP, Ruby)

Examples shown for 2026-06-29, 14:05.

TokenMeansExample
%YFour-digit year.2026
%yTwo-digit year.26
%mMonth, zero-padded.06
%dDay of month, zero-padded.29
%HHour, 24-hour.14
%IHour, 12-hour.02
%MMinute.05
%SSecond.00
%pAM or PM.PM
%AFull weekday name.Monday
%BFull month name.June
%jDay of the year.180
%zUTC offset.+0000

Unicode tokens (date-fns, Day.js)

Used by many JavaScript date libraries.

TokenMeans
yyyyFour-digit year.
MMMonth, zero-padded.
MMMMFull month name.
ddDay of month, zero-padded.
EEEEFull weekday name.
HHHour, 24-hour.
hhHour, 12-hour.
mmMinute.
ssSecond.
aAM or PM.
JavaScript's built-in Date is differentNative Intl.DateTimeFormat uses an options object, not format tokens. The Unicode tokens above apply to libraries like date-fns and Day.js, not the built-in Date.toLocaleString.

References

Questions

Why does %m mean month but mm sometimes mean minutes?

They are different systems. In strftime, %m is month and %M is minute. In Unicode tokens, MM is month and mm is minute, with case carrying the meaning.

Can I use strftime tokens in JavaScript?

Not with the built-in Date. Native formatting uses Intl options. To use tokens like yyyy-MM-dd in JavaScript, use a library such as date-fns or Day.js.