ISO 8601 Cheatsheet
Sections
8
topics
Rows
22
patterns
Coverage
ISO 8601
spec
Mode
reference
static
input · how to read
Layout
Format column is the spec syntax. Example column shows what real data looks like. Note adds context.
Tip
For APIs, default to YYYY-MM-DDTHH:MM:SSZ. RFC 3339 is a stricter subset of ISO 8601 — also accepted.
output · sections
Calendar dates
YYYY-MM-DD
2024-01-15
Extended date (most common).
YYYYMMDD
20240115
Basic date (no separators).
--MM-DD
--01-15
Month-day only (year unknown).
YYYY-MM
2024-01
Year-month only.
YYYY
2024
Just the year.
Week dates
YYYY-Www-D
2024-W03-1
Year, ISO week, day-of-week (1=Mon).
YYYY-Www
2024-W03
Year + ISO week.
Ordinal dates
YYYY-DDD
2024-015
Day of year.
Times
hh:mm:ss
14:30:00
Extended time.
hhmmss
143000
Basic time.
hh:mm:ss.sss
14:30:00.250
With milliseconds.
hh:mm
14:30
No seconds.
Time zones
Z
14:30:00Z
UTC (Zulu time).
±hh:mm
14:30:00+05:00
Offset from UTC.
±hhmm
143000+0500
Basic offset.
Date + time
YYYY-MM-DDTHH:MM:SS
2024-01-15T14:30:00
T separator. No timezone = local.
YYYY-MM-DDTHH:MM:SSZ
2024-01-15T14:30:00Z
UTC instant (most common in APIs).
YYYY-MM-DDTHH:MM:SS±hh:mm
2024-01-15T14:30:00+05:00
With explicit offset.
Durations
PnYnMnDTnHnMnS
P3Y6M4DT12H30M5S
ISO 8601 duration: 3y 6mo 4d 12h 30m 5s.
PnW
P2W
Weeks-only duration.
Intervals
<start>/<end>
2024-01-01/2024-12-31
Range of two dates.
<start>/<duration>
2024-01-01/P1M
Start + duration.