ISO 8601 and RFC 3339: how to write dates and times
Write the year first, then the month, then the day. That one habit makes dates sort correctly and removes the day-month confusion.
The format
RFC 3339 defines a profile of ISO 8601 for the internet. A full timestamp looks like this:
2026-11-13T10:20:00+05:30
Reading from the left: the year with four digits, a hyphen, the month with two digits, a hyphen, the day with two digits, the letter T that separates date from time, the hour in the 24-hour clock, a colon, the minutes, a colon, the seconds, and finally the offset from UTC. For UTC the offset is written as the letter Z ("Zulu"): 2026-11-13T04:50:00Z. The same instant can be written with different offsets.
Optional parts
A fraction of a second may follow the seconds: 2026-11-13T04:50:00.250Z. A date alone is 2026-11-13. RFC 3339 allows a space instead of the T for readability, in some uses, but the T is the safest choice when programs will read it.
Why this format is good
- It sorts as text. Alphabetical order is time order, as long as the zone is the same.
- It has no ambiguity. 03/04/2026 can be March 4 or 3 April. 2026-04-03 cannot.
- Programs everywhere read it. Browsers, databases, APIs and languages understand it.
- It carries the offset, so the instant is clear.
Mistakes to avoid
- Leaving out the offset:
2026-11-13T10:20:00is a local time with no zone, and different programs will interpret it in different zones. - Using 12-hour times with AM and PM.
- Writing
24:00for midnight. Use00:00of the next day. - Using two-digit years.
- Writing the offset without the colon in places that require the colon.
Examples
| Meaning | Written |
|---|---|
| A date | 2026-11-13 |
| 10:20 in India | 2026-11-13T10:20:00+05:30 |
| The same instant in UTC | 2026-11-13T04:50:00Z |
| With milliseconds | 2026-11-13T04:50:00.250Z |
You can check any of them in the epoch converter: paste the text and read the seconds.
In programs
JavaScript's toISOString() gives the UTC form with milliseconds. Python's datetime.isoformat() gives the form with an offset when the object has a time zone. Most databases accept the format as input.
What is the Z?
It means zero offset from UTC (Zulu time).
Is ISO 8601 the same as RFC 3339?
RFC 3339 is a stricter profile of ISO 8601 for internet use.
Sources
- RFC 3339, Date and Time on the Internet: Timestamps (read 14 November 2026)
This is an independent guide. It is not connected with the IERS, BIPM, IANA, NIST or any company named here. Facts were read on 14 November 2026 from the sources named on each page; calculated values come from Python.