ISO 8601 Date Format Explained
Learn the ISO 8601 date and time format standard used in APIs, databases, and data interchange. Covers extended and basic formats, timezone designators, and durations.
Detailed Explanation
ISO 8601 — The International Date Standard
ISO 8601 is the international standard for representing dates, times, and time intervals. It was first published in 1988 and has become the de-facto format for data interchange across APIs, databases, and configuration files.
Core Format
The most common ISO 8601 representation is the extended format:
2026-02-28T14:30:00Z
2026-02-28T14:30:00+09:00
2026-02-28T14:30:00.123Z
Breaking this down:
2026— Four-digit year02— Two-digit month (zero-padded)28— Two-digit day (zero-padded)T— Literal separator between date and time14:30:00— Hours, minutes, seconds in 24-hour formatZ— UTC timezone designator (or an offset like+09:00)
Basic Format
ISO 8601 also defines a basic format without separators:
20260228T143000Z
This is less readable but more compact, used in some file naming conventions and compact data formats.
Timezone Designators
Z— UTC (also called "Zulu time")+09:00— Positive offset from UTC (e.g., JST)-05:00— Negative offset from UTC (e.g., EST)
Why ISO 8601 Matters
- Unambiguous — Unlike "02/03/2026" which could mean Feb 3 or March 2, ISO 8601 has one interpretation
- Sortable — String sorting produces chronological order
- Timezone-aware — The offset or Z suffix makes the absolute moment unambiguous
- Machine-readable — Every major language has built-in ISO 8601 parsing
Language Patterns
| Language | Pattern |
|---|---|
| JavaScript (date-fns) | yyyy-MM-dd'T'HH:mm:ssxxx |
| Python | %Y-%m-%dT%H:%M:%S%z |
| Java | yyyy-MM-dd'T'HH:mm:ssXXX |
| PHP | Y-m-d\TH:i:sP |
| Go | 2006-01-02T15:04:05-07:00 |
| C# | yyyy-MM-dd'T'HH:mm:sszzz |
Use Case
ISO 8601 is the standard format for REST API responses, JSON serialization, database timestamps, log files, and any scenario requiring unambiguous date interchange between systems. JavaScript's Date.toISOString() outputs this format natively.