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:
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.
Related Resources
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.
For additional information on related topics, take a look at the following resources:
- Using Python's datetime Module (Course)
- A Beginner’s Guide to the Python time Module (Tutorial)
- Mastering Python's Built-in time Module (Course)
- The Python calendar Module: Create Calendars With Python (Tutorial)
- Working With JSON Data in Python (Tutorial)
- The Python calendar Module (Quiz)
- Working With JSON in Python (Course)
- Working With JSON Data in Python (Quiz)
By Martin Breuss • Updated July 13, 2026