ISO 8601 timestamp
ISO 8601 is the international standard for writing dates and times unambiguously, and RFC 3339 is the strict internet profile of it, such as 2026-09-18T14:30:00Z. Both put the largest unit first, so the text sorts in chronological order.
Anatomy of a timestamp
2026-09-18T14:30:00.250+02:00
2026-09-18: year, month, day.T: separates the date from the time.14:30:00: hours, minutes and seconds in 24-hour time..250: optional fractional seconds.+02:00: the offset from UTC.Zmeans zero offset (UTC), so2026-09-18T12:30:00.250Zis the same moment as the example above.
ISO 8601 versus RFC 3339
ISO 8601 is a large standard: it also covers week dates (2026-W38-5), ordinal dates, durations (P3DT4H), intervals and dates with no time. RFC 3339 deliberately covers a small subset: full timestamps, with the time and the UTC offset always present. Most APIs, JSON payloads and log formats that say “ISO 8601” actually mean an RFC 3339 timestamp.
Why it is the recommended format
- Unambiguous.
03/04/2026is March or April depending on where you are.2026-03-04is always the same date. - Sorts correctly as text, as long as the offsets match.
- Carries its zone. The offset says exactly which moment is meant, without depending on the reader’s locale.
- Human-readable, unlike a raw Unix timestamp.
Common pitfalls
- Leaving out the offset.
2026-09-18T14:30:00does not say which zone it is in. In JavaScript it is parsed as local time, while the date-only form2026-09-18is parsed as UTC. That inconsistency causes off-by-one-day bugs. - Comparing strings with different offsets.
2026-09-18T12:00:00+02:00and2026-09-18T10:00:00Zare the same instant but do not compare equal as text. Parse to a real time value first. - Storing local time. Store UTC, and keep the user’s zone separately if you need it.
- Assuming a strict parser. RFC 3339 allows a space instead of
Tand a lowercasetorzin some contexts, and leap seconds such as23:59:60are legal. Libraries differ in what they accept.
Related terms
- Unix timestamp — A Unix timestamp is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970, the Unix epoch. It is a single number that identifies a moment in time regardless of time zone, which makes it easy to store, sort and compare.
- JWT (JSON Web Token) — A JSON Web Token is a compact, URL-safe string that carries a set of claims as JSON, usually signed so the receiver can detect tampering. It is defined in RFC 7519 and is widely used for API and session authentication.
References
Ads on this page
Non-personalized ads help keep Vaultools free — Google decides where they appear on the page.
Go Pro to remove them →