RFC 3339
The strict, unambiguous internet profile of ISO 8601 — what your APIs should use.
RFC 3339 (“Date and Time on the Internet: Timestamps”) defines a tightly
constrained profile of ISO 8601 for use in internet protocols and applications.
Every RFC 3339 value is a full date-time: a calendar date, a T separator, a
time of day to at least second precision, and a mandatory UTC offset — either
Z (zero offset) or ±hh:mm. Because the offset is required, every value
unambiguously names a point on the timeline.
Compared to ISO 8601, RFC 3339 is deliberately narrower: it forbids week dates,
ordinal dates, durations, intervals, and the basic (no-separator) format. It
does allow lowercase t and z in the separator and offset positions, and
permits replacing the T with a space when sender and receiver agree — but in
practice, uppercase T and Z are the universal convention.
RFC 3339 and ISO 8601 overlap substantially but neither is a strict superset of
the other in every nuance (for example, RFC 3339 mandates ±hh:mm while ISO
8601 also allows ±hh and ±hhmm; conversely RFC 3339 accepts a space in place
of T and the -00:00 “unknown offset”, which ISO 8601 does not). ijmacd’s
interactive RFC 3339 vs ISO 8601 Venn diagram
lays out which formats fall in each region. For API design and storage
interchange, RFC 3339 is the right choice: it is free, unambiguous, and widely
implemented.
Use it for APIs and storage
When you control the format — outbound API responses, log timestamps, database text columns, message queues — emit RFC 3339. Consumers can parse it unambiguously without negotiating which ISO 8601 subset is in play.
Pitfall: Emitting a timestamp without an offset (e.g. 2026-06-05T14:30:00)
is not valid RFC 3339 — and forces every consumer to guess the zone. Always
include Z or an explicit ±hh:mm.
Go deeper: RFC 3339 vs ISO 8601 in practice, and fractional seconds
RFC 3339 explicitly permits fractional seconds with a decimal point: e.g.
2026-06-05T14:30:00.123Z. The number of decimal digits is unrestricted by the
spec, though most systems emit three (milliseconds) or six (microseconds).
Receiving code should accept any number of fractional digits.
One nuance: ISO 8601 allows the decimal fraction on any of hours, minutes, or
seconds (14:30.5 meaning 30 and a half minutes past 14:00). RFC 3339 only
places it on the seconds field. This is one example of a case where a valid ISO
8601 string is not valid RFC 3339.
For a full picture of what ISO 8601 permits beyond RFC 3339’s profile, see ISO 8601. For guidance on API date-time design including time zone handling between clients and servers, see Client-server patterns.