ISO 8601 Date and Time Format

The international standard for representing dates, times, and datetime values

What is ISO 8601?

ISO 8601 is an international standard published by the International Organization for Standardization (ISO) that defines formats for representing dates, times, time intervals, recurring time intervals, and durations. It provides unambiguous, machine-readable date and time representations that work across different systems, languages, and cultural boundaries.

The standard was first published in 1988, replacing several older ISO standards for date and time notation (ISO 2014, ISO 2015, ISO 2711, ISO 3307, and ISO 4031). It has undergone several revisions, with the latest edition being ISO 8601-1:2019 and ISO 8601-2:2019. The key principles behind ISO 8601 are simplicity, unambiguity, and universal comprehension. By arranging date components from largest to smallest (year, month, day) and always using 24-hour time, the standard eliminates the confusion that arises from region-specific formats. ISO 8601 is now the de facto format for datetime exchange in computing, international trade, scientific research, aviation, and government documentation worldwide.

ISO 8601 Date Formats

ISO 8601 defines several ways to represent dates. The most widely used is the extended format with hyphens, but the standard also supports a basic format without separators, week dates, and ordinal dates.

Calendar Date: YYYY-MM-DD

The basic ISO 8601 calendar date format is:

YYYY-MM-DD

Where:

Examples:

The hyphens are optional in the basic format, giving 20260424 as a compact alternative. The extended format (with hyphens) is strongly recommended for human readability and is the format most commonly used in practice.

Week Date: YYYY-Www-D

ISO 8601 also defines a week date system where each week starts on Monday and is numbered 01 through 52 or 53. Week 01 is the week containing the first Thursday of the year. The format is:

YYYY-Www-D

Where Www is the week number and D is the weekday digit (1 = Monday through 7 = Sunday). Examples:

The basic format removes hyphens: 2026W303. Week dates are commonly used in manufacturing, logistics, and financial reporting where weekly scheduling is important.

Ordinal Date: YYYY-DDD

Ordinal dates represent the day of the year as a three-digit number (001-365, or 366 in leap years):

YYYY-DDD

Examples:

Ordinal dates are useful in scientific and engineering contexts where tracking the consecutive day number is more practical than calendar months.

ISO 8601 Time Formats

The ISO 8601 time format strictly uses 24-hour clock notation, eliminating the ambiguity of AM/PM designations. The extended format uses colons, while the basic format omits them:

HH:MM:SS

Where:

Examples:

The basic format omits the colons: 143000. ISO 8601 also allows omitting hours and minutes when they are zero, though this is rarely used in practice. Midnight can be represented as either 00:00:00 (start of day) or 24:00:00 (end of day), though the former is strongly preferred.

ISO 8601 Combined Date and Time

When combining a date and a time into a single datetime value, the letter T is used as the separator between the date and time components:

YYYY-MM-DDTHH:MM:SS

The T stands for "time" and serves as a fixed delimiter that makes the combined format unambiguous to parse. This format is the backbone of modern datetime interchange and is used extensively in APIs, databases, log files, and configuration files.

Examples:

Decimal Fractions

For sub-second precision, ISO 8601 allows decimal fractions on the smallest time component:

The decimal separator can be either a comma (preferred by ISO) or a period (more common in computing). Both 14:30:00,5 and 14:30:00.5 are valid under the standard.

Time Zone Designators

ISO 8601 supports time zone information to make datetime values fully unambiguous across the globe. Without a time zone designator, the time is considered local time with no offset specified.

UTC (Zulu Time)

Use Z to indicate Coordinated Universal Time (UTC):

2026-04-24T14:30:00Z

The Z stands for "Zulu" — the military and NATO designation for UTC. A time ending in Z is always in UTC, regardless of the observer's location. This is the safest way to represent a global timestamp.

Offset from UTC

You can also specify the offset from UTC using ±HH:MM:

A full datetime with offset looks like: 2026-07-15T10:30:00-04:00 (10:30 AM in New York during daylight time). The offset indicates how far the local time is from UTC — negative offsets are west of UTC, positive offsets are east.

ISO 8601 in Programming

ISO 8601 is the dominant datetime format in modern software development. JSON, the most common data interchange format on the web, uses ISO 8601 as its standard for datetime representation as specified in ECMA-404. Most programming languages provide built-in support for generating and parsing ISO 8601 strings:

JavaScript

new Date().toISOString()
// "2026-04-24T14:30:00.123Z"

JavaScript's Date.toISOString() always returns ISO 8601 in UTC, with milliseconds and the Z suffix. The Date.parse() method natively understands ISO 8601 strings.

Python

from datetime import datetime, timezone
datetime.now(timezone.utc).isoformat()
# "2026-04-24T14:30:00.123456+00:00"

Python's datetime.isoformat() produces ISO 8601-compliant output and accepts ISO 8601 input via datetime.fromisoformat().

Other Languages

Most modern databases (PostgreSQL, MySQL, SQLite) also store and accept ISO 8601 datetime strings in their datetime and timestamp columns, making it the universal bridge between systems.

ISO 8601 vs Other Date Formats

Several date and time formats exist, each with different strengths and weaknesses. Here is how ISO 8601 compares to the most common alternatives:

Format Example Notes
ISO 8601 2026-07-15 Unambiguous, sortable, international
US (MM/DD/YYYY) 07/15/2026 Ambiguous outside the US — confused with DD/MM/YYYY
European (DD/MM/YYYY) 15/07/2026 Ambiguous in the US — difficult to sort as strings
Unix Timestamp 1789422600 Compact integer, but not human-readable and timezone-dependent without conversion
RFC 2822 Tue, 15 Jul 2026 14:30:00 GMT Human-friendly weekday name, but verbose and harder to parse

Unambiguous Date Format

The biggest advantage of ISO 8601 is that it cannot be misinterpreted. With US format 04/05/2026, you cannot tell whether it is April 5 or May 4. ISO 8601's big-endian ordering (year first) eliminates this confusion entirely. The year-first structure also makes string sorting equivalent to chronological sorting — an extremely useful property for filenames, log entries, and database keys.

Why ISO 8601 Matters

ISO 8601 is not just a technical specification — it is a solution to a fundamental communication problem. Before ISO 8601, date formats were a constant source of errors in international contexts. A date written as 03/04/05 could be interpreted as March 4, 2005 (US), April 3, 2005 (European), or even April 5, 2003 (some Asian formats).

ISO 8601 solves this by enforcing a consistent, unambiguous format recognized worldwide. Because it places the year first, ISO 8601 dates sort correctly when treated as plain strings in alphabetical order. This property is invaluable for log files, database indexes, and file naming conventions where chronological ordering is needed without explicit date parsing.

Today, ISO 8601 is embedded in almost every layer of modern technology: the JSON specification mandates it, XML Schema uses it, HTTP headers exchange timestamps in it, and cloud APIs from AWS, Google Cloud, and Azure all rely on it. PostgreSQL, MySQL, MongoDB, and other major databases store datetimes using ISO 8601 internally or accept it as input. In short, ISO 8601 is the closest thing the world has to a universal language for dates and times.

Related Formats

ISO 8601 is closely related to these standards:

See Also

Learn more: Wikipedia: ISO 8601 | ISO: ISO 8601 Standard