The complete ISO 8601 guide.
ISO 8601 is the international standard for representing dates and times as text. It's the format you should use whenever you can. It's unambiguous, sortable, and supported everywhere. This page covers every common variant you'll encounter.
Why ISO 8601?
Before ISO 8601, every region had its own date format. Is 01/02/2025 January 2 or February 1? Depends on whether you're American or European, and the format gives no clue. ISO 8601 fixes this with a globally unambiguous syntax based on three principles: largest unit first, zero-padded, and explicit time zone offsets.
The core format
2025-01-01T14:30:00Z
└────────┘ └──────┘└┘
date time tz
The three parts are separated by T. The Z at the end means UTC (it stands for "Zulu time"). Without a timezone marker, the value is local time and shouldn't cross system boundaries.
Date formats
| Form | Example | Meaning |
|---|---|---|
| Full calendar date | 2025-01-01 | January 1, 2025 |
| Year and month only | 2025-01 | January 2025 (any day) |
| Year only | 2025 | The year 2025 |
| Ordinal date | 2025-001 | 1st day of 2025 (Jan 1) |
| Week date | 2025-W01-3 | 3rd day (Wed) of week 1 of 2025 |
Time formats
| Form | Example | Meaning |
|---|---|---|
| Hour, min, sec | 14:30:00 | 2:30 PM exact |
| Hour, min | 14:30 | 2:30 PM (no seconds) |
| With ms | 14:30:00.123 | 2:30:00 and 123ms |
| With μs | 14:30:00.123456 | 2:30:00.123456 |
| Hour only | 14 | 2 PM, no minutes |
Timezone designators
| Form | Example | Meaning |
|---|---|---|
Z | 2025-01-01T14:30:00Z | UTC |
+HH:MM | 2025-01-01T14:30:00+05:30 | 5h 30m east of UTC (India) |
-HH:MM | 2025-01-01T14:30:00-05:00 | 5h west of UTC (Eastern Time) |
+HHMM | 2025-01-01T14:30:00+0530 | Same as +05:30 |
| (none) | 2025-01-01T14:30:00 | Local time: ambiguous! |
Durations
ISO 8601 also defines a syntax for durations using the P prefix:
P1Y → 1 year
P1M → 1 month
P1D → 1 day
PT1H → 1 hour
PT30M → 30 minutes
PT15S → 15 seconds
P1Y2M3DT4H5M6S → 1 year, 2 months, 3 days, 4h 5m 6s
P1W → 1 week
The T separates date parts from time parts. M means "month" before T but "minute" after. This is the standard's main quirk.
Intervals
2025-01-01T00:00:00Z/2025-01-08T00:00:00Z → start / end
2025-01-01T00:00:00Z/P1W → start / duration
P1W/2025-01-08T00:00:00Z → duration / end
Best practices
- Always include the timezone designator (
Zor offset). Local times can't be safely shared between systems. - Use UTC for storage. Convert to local time only when displaying to users.
- Prefer extended format (
2025-01-01T14:30:00Z) over basic format (20250101T143000Z): easier for humans to read. - Sortable as strings. ISO 8601 timestamps sort correctly with plain text comparison:
"2025-01-01" < "2025-12-31"works. - Use it in JSON. The default for
JSON.stringify(new Date())in JavaScript is ISO 8601, which is exactly what you want.
RFC 3339: the subset you actually use
If "ISO 8601" feels overwhelming, here's the good news: RFC 3339 is a stricter profile of ISO 8601 that covers most real-world use. It requires:
- Full extended-format date with hyphens:
2025-01-01 Tas the date-time separator- Time with at least hours, minutes, seconds:
14:30:00 - Either
Zor a±HH:MMoffset
That's it. If you produce RFC 3339, you're guaranteed valid ISO 8601 too, and it's universally parseable.
Try it
Paste any ISO 8601 string into the main converter to see how it parses, what Unix timestamp it represents, and how it looks in other formats.
Last updated: