ISO 8601 date and time formats
ISO 8601 is the international standard for representing dates, times, durations and intervals as unambiguous text. It underpins RFC 3339, most web APIs, and database timestamp formats. This reference groups the standard’s representations — dates, times, durations and intervals — and shows each in both basic and extended form with a worked example.
How it works
A complete ISO 8601 timestamp combines a date and a time joined by T, optionally with a timezone designator: 2026-06-11T14:30:00Z.
Dates come in three flavours: calendar (YYYY-MM-DD), ordinal (YYYY-DDD, day-of-year), and week date (YYYY-Www-D). Week numbering is ISO-specific: weeks start Monday, and week 1 holds the year’s first Thursday.
Times are hh:mm:ss with optional fractional seconds (.sss) and a timezone: Z for UTC or ±hh:mm for an offset. Reduced precision is allowed, e.g. 14:30.
Durations use the P[n]Y[n]M[n]D T[n]H[n]M[n]S grammar — a leading P, then date parts, then T before time parts. PT0S and P0D both denote zero.
Intervals combine two of the above with a /: start/end (2026-06-01/2026-06-30), start/duration (2026-06-01/P1M), or duration/end (P1M/2026-06-30).
Tips and example
Across categories the sample instant 2026-06-11 14:30:00 UTC renders as:
calendar 2026-06-11
ordinal 2026-162
week date 2026-W24-4
datetime 2026-06-11T14:30:00Z
offset 2026-06-11T16:30:00+02:00
Prefer the extended form with explicit offsets in stored data — bare local times lose meaning across timezones. When you only need a date, use YYYY-MM-DD; it sorts lexicographically into chronological order, which is handy for filenames and keys. Use the filter below to find the exact pattern for any case.