Skip to content

ISO 8601

ISO 8601 is an international standard for writing dates and times as text, ordered from the largest unit of time to the smallest. Under this scheme, June 10, 2026 becomes 2026-06-10, and a full timestamp reads 2026-06-10T14:30:00+00:00. Because larger units always come first, sorting the strings in lexicographic order also sorts them chronologically.

The combined format separates the calendar date from the 24-hour time with the letter T and ends with a UTC offset, where Z is shorthand for +00:00. Every part has a fixed position in the string:

A teal box with the timestamp 2026-06-10T14:30:00+00:00 above four white boxes labeling its parts: calendar date, separator T, 24-hour time, and UTC offset.
A full ISO 8601 timestamp combines a calendar date, the separator T, a 24-hour time, and a UTC offset.

The standard also defines week dates such as 2026-W24-3 and ordinal dates such as 2026-161, which both name the same day as 2026-06-10, plus durations such as P3Y6M4D.

The International Organization for Standardization first published ISO 8601 in 1988 and now splits it into two parts, ISO 8601-1:2019 for the core date and time rules and ISO 8601-2:2019 for extensions. RFC 3339, a stricter profile of the standard, governs timestamps in internet protocols.

The notation sidesteps the regional ambiguity between day-first and month-first dates, so APIs, logs, file names, and databases routinely exchange timestamps in this form. In Python, datetime objects emit the format through .isoformat() and parse it with .fromisoformat(), which accepts most ISO 8601 representations since Python 3.11.

Using Python datetime to Work With Dates and Times

Tutorial

Using Python datetime to Work With Dates and Times

Have you ever wondered about working with dates and times in Python? In this tutorial, you'll learn all about the built-in Python datetime library. You'll also learn about how to manage time zones and daylight saving time, and how to do accurate arithmetic on dates and times.

intermediate stdlib

For additional information on related topics, take a look at the following resources:


By Martin Breuss • Updated July 13, 2026