Developer Time · Standard

The ISO 8601 Date and Time Format, Fully Explained

One international standard says exactly how a date or time should be written as text — no locale guesswork, no month-day confusion. Here is every part of it: dates, times, the T and the Z, week dates, ordinal dates, durations, and how it relates to RFC 3339.

By Reviewed 9 min read

Key takeaways

  • ISO 8601 is the international standard for writing dates and times as text so any system, in any country, parses them the same way.
  • Dates are written year-month-day: 2026-08-31. Times use a 24-hour clock only: 14:30:00.
  • A capital T joins a date and time together; a Z (or an explicit ±hh:mm offset) marks which clock the time belongs to.
  • Two lesser-known but fully valid forms exist: week dates (2026-W36-1) and ordinal dates (2026-243).
  • Durations use a P…T… syntax, e.g. P1Y2M10DT2H30M for 1 year, 2 months, 10 days, 2 hours, 30 minutes.
  • RFC 3339, the format behind most web APIs, is a stricter subset of ISO 8601 — not a separate standard.

An API returns 2026-08-31T14:30:00Z and, without checking any documentation, you know exactly what it means: the 31st of August 2026, half past two in the afternoon, Coordinated Universal Time. Compare that to 08/09/2026 — is that the 8th of September or the 9th of August? Nobody reading that string alone can be certain. That gap between "unambiguous" and "depends who's reading it" is the entire reason ISO 8601 exists.

This guide covers the standard itself, in full: the date and time formats, how they combine, the less-common week-date and ordinal-date forms, how durations are written, and where ISO 8601 ends and RFC 3339 — the profile most web APIs actually use — begins. If you specifically need to convert a Unix timestamp into this format, the timestamp conversion guide covers that; this page is about the notation itself.

01What ISO 8601 actually is

ISO 8601 is a standard published by the International Organization for Standardization, most recently revised in 2019, that defines exactly how to write calendar dates, times of day, and durations as plain text. Its job isn't to make a date look nice on a printed page for a human — it's an interchange format, meant for the moment one system hands a date to another: a database column, a JSON field, a log line, a filename. When both sides of that handoff follow the same rule, there's nothing left to misread.

The standard deliberately leaves some things out. It has no concept of a 12-hour clock, no AM/PM, and no named time zones like "Eastern Time" — for the reasoning behind 24-hour notation itself, see how to read the 24-hour clock. What it does define, it defines precisely: four separate representations — calendar date, time of day, week date, and ordinal date — plus a syntax for combining a date with a time and for expressing a span of time.

02The date format: YYYY-MM-DD

The most familiar piece of ISO 8601 is its calendar date: a four-digit year, a two-digit month, and a two-digit day, always in that order and always zero-padded — 2026-08-31 for the 31st of August 2026, never 2026-8-31. The hyphens are what the standard calls "extended format"; a compact "basic format" without separators also exists — 20260831 — and shows up mostly in filenames and machine-generated identifiers rather than anything a person reads directly.

The year-month-day order isn't arbitrary. Writing the largest unit first means that two ISO dates sort correctly even as plain text strings, with no date-aware logic required — 2026-01-05 naturally sorts before 2026-08-31. It also sidesteps the regional split between MM/DD/YYYY and DD/MM/YYYY entirely, since neither of those orderings is valid ISO 8601.

Always four digits for the year

ISO 8601 expects a full four-digit year. A truncated two-digit year like 26-08-31 isn't part of the standard — it reintroduces exactly the kind of ambiguity (which century?) that a fixed-width year format is meant to remove.

03The time format: hh:mm:ss

Times of day follow the same zero-padded, largest-unit-first logic: two digits for the hour, two for the minutes, two for the seconds, separated by colons in extended format — 14:30:00 for half past two in the afternoon. The clock always runs 00 to 23; there is no AM or PM anywhere in the standard. Basic format drops the colons the same way dates drop their hyphens: 143000.

Fractions of a second, when needed, are added after a decimal mark — 14:30:00.5 for half past two and half a second. The standard's own preference is a comma, but a period is what almost every programming language and API actually emits, and both are accepted. One more allowance is easy to miss: 24:00:00 is a valid way to write the exact end of a day, equivalent to 00:00:00 at the start of the next one — though in practice, systems overwhelmingly write the next day's midnight instead.

04Combining date and time: T and Z

Joining a date and a time into one string needs a separator, or 20260831143000 would be an unreadable run of fourteen digits. ISO 8601 solves this with a literal capital letter T: 2026-08-31T14:30:00. The T isn't an abbreviation for anything in particular — it's simply the fixed marker the standard chose to divide the date part from the time part.

What that time actually refers to — whose clock it's on — is a separate question, answered with a suffix. A trailing Z stands for "Zulu time," military and aviation shorthand for UTC, and is exactly equivalent to an offset of +00:00: 2026-08-31T14:30:00Z. For any other zone, the offset is written explicitly as ±hh:mm — 2026-08-31T19:30:00+05:00 is the same instant, five hours ahead of UTC. A date-time with neither a Z nor an offset is technically valid ISO 8601, but it leaves the reader guessing which clock it was written on — for that concept in general, see what UTC actually is.

For machine-to-machine exchange, always include one

A timestamp without Z or an offset isn't wrong, exactly — it's just under-specified. Any time a date-time string will be read by another system, program, or person in a different zone, attach an explicit offset or use Z. It costs six characters and removes an entire category of bugs.

05See it live: this moment in ISO 8601

Four ways to write the same instant, generated from your device's clock and updating as the seconds tick over:

Right now, in ISO 8601

—

Basic format

—

Week date

—

Ordinal date

—

Date only

—

Converting a specific date or timestamp?

This is a live view of "now," not a converter. To turn any date or Unix timestamp into ISO 8601 (or the reverse), use the ISO 8601 converter or the Unix timestamp converter.

06Week dates: YYYY-Www-D

Alongside the calendar date, ISO 8601 defines an entirely separate way to identify a day: by its position in a numbered week. The format is YYYY-Www-D — a four-digit year, a literal W, a two-digit week number, and a day-of-week digit from 1 (Monday) to 7 (Sunday). Monday the 31st of August 2026 is week 36 of that year, so it's written 2026-W36-1.

The rule for where week 1 starts is precise and easy to state, if not entirely intuitive: week 1 of a year is the week that contains that year's first Thursday, which is the same as saying it's the week containing 4 January. Weeks always run Monday to Sunday. One consequence of anchoring to Thursday rather than 1 January is that the boundaries don't line up neatly with the calendar year — the final days of December can fall into week 1 of the following ISO year, and the first days of January can still belong to week 52 or 53 of the year before. Most years have 52 ISO weeks; some have 53.

Week dates aren't something most people write by hand, but they turn up regularly in European fiscal planning, manufacturing schedules, and logistics systems, and in the "week number" a spreadsheet or calendar app shows next to a date.

07Ordinal dates: YYYY-DDD

The least common of the three date forms counts straight through the year: YYYY-DDD, where DDD is a three-digit day-of-year from 001 to 365 (or 366 in a leap year). The 31st of August 2026 is the 243rd day of that year, so its ordinal date is 2026-243.

Ordinal dates are rare in everyday writing but do appear in manufacturing date codes, some scientific data formats, and older mainframe and inventory systems where a fixed-width day count was cheaper to store and compare than a month-and-day pair. If you come across a seven-character date with no separator between the last three digits, this is very likely what it is.

08Durations and intervals

ISO 8601 also defines a syntax for a length of time, rather than a point in time. A duration starts with a literal P (for "period"), followed by a number and a unit for each component: Y for years, M for months, D for days, then — if any time components follow — a literal T, then H for hours, M for minutes, and S for seconds. The T is what tells M apart from M: before it, M means months; after it, M means minutes.

Reading a duration

  • Whole stringP1Y2M10DT2H30M
  • Date part (before T)1 year, 2 months, 10 days
  • Time part (after T)2 hours, 30 minutes

Short durations drop whatever isn't needed: PT30M is simply 30 minutes, and P7D is 7 days with no time component at all, so no T is needed. Durations combine with dates to express intervals — a start and an end (2026-08-01T00:00:00Z/2026-08-31T23:59:59Z), or a start and a duration (2026-08-01T00:00:00Z/P30D) — though the precise arithmetic for adding or measuring spans of time on a calendar is its own topic, covered in the guide to adding and subtracting time.

09ISO 8601 vs RFC 3339

Almost every "ISO format" timestamp seen in a web API, a JSON payload, or an HTTP header is, strictly speaking, following RFC 3339 — a specification published by the Internet Engineering Task Force that describes itself as a profile of ISO 8601 built specifically for internet protocols. It isn't a rival standard; it's a deliberately narrowed slice of ISO 8601's much larger rulebook, chosen because a full ISO 8601 parser has to handle far more variation than any single API needs to produce.

The narrowing runs one direction: RFC 3339 always requires an explicit UTC offset or Z on a date-time, where ISO 8601 permits leaving it off. RFC 3339 doesn't include the week-date or ordinal-date forms at all, and it doesn't use the separator-free basic format — every RFC 3339 timestamp uses hyphens and colons. In exchange, RFC 3339 relaxes a couple of things ISO 8601 is stricter about, such as allowing a lowercase t or even a plain space in place of the capital T. In practice: every valid RFC 3339 string is valid ISO 8601, but the reverse isn't guaranteed.

Which one should your API use?

For logs, database columns, and REST or JSON APIs, follow RFC 3339: extended format, always with an explicit offset or Z. It's the subset every mainstream date library parses reliably, and it sidesteps the rarer ISO 8601 forms that most consumers of your API were never built to expect.

10Common mistakes and misconceptions

  • Calling MM/DD/YYYY or DD/MM/YYYY "ISO format." Neither is ISO 8601 — the standard fixes the order as year, month, day with hyphens, with no regional variation.
  • Dropping the offset and assuming it's implied. A date-time with no Z and no ±hh:mm is valid but ambiguous about whose clock it's on.
  • Assuming ISO week 1 always begins on 1 January. It begins on the Monday of the week containing the year's first Thursday, which can fall in late December of the previous year.
  • Treating 24:00:00 as an error. It's a valid way to write the instant at the end of a day, even though 00:00:00 the next day is far more common in practice.
  • Assuming any string with hyphens and a T is automatically valid ISO 8601. A malformed or truncated variant — a missing leading zero, a two-digit year, an invalid month — is still invalid, appearances aside.

Convert to and from ISO 8601 instantly

Turn any date, time, or Unix timestamp into ISO 8601 — or read one back into a normal date — free, no sign-up.

Open the ISO 8601 converter →

11Frequently asked questions

What is the correct ISO 8601 date format?

YYYY-MM-DD — a four-digit year, a two-digit month, and a two-digit day, separated by hyphens, in that order. 31 August 2026 is written 2026-08-31.

Does ISO 8601 use a 12-hour or 24-hour clock?

A 24-hour clock only. ISO 8601 has no AM/PM notation, so 2:30 PM is written 14:30:00.

What does the Z at the end of an ISO 8601 timestamp mean?

Z stands for "Zulu time" and marks the timestamp as UTC. It is exactly equivalent to writing an offset of +00:00.

What's the difference between ISO 8601 and RFC 3339?

RFC 3339 is a stricter internet profile of ISO 8601 used by most web APIs. It always requires an explicit UTC offset and drops less-common ISO 8601 forms such as week dates, ordinal dates, and the separator-free basic format.

Does ISO week 1 always start on 1 January?

No. ISO week 1 is defined as the week containing the year's first Thursday, so its Monday can fall as early as 29 December of the previous year.

How do you write a duration in ISO 8601?

With a P prefix followed by years, months, and days, then a T and hours, minutes, and seconds — for example P1Y2M10DT2H30M means 1 year, 2 months, 10 days, 2 hours, and 30 minutes.

Fletcher Langley

Fletcher Langley

Time & Scheduling Specialist · 24hourto12hour.com

Operations and workforce-systems specialist with 14+ years inside shift-based industries and payroll platforms. Fletcher builds and reviews every tool on the site, and writes its guides so the method is always shown, not just the answer. Read his full profile →

Sources & standards

  1. ISO 8601-1:2019, Date and time — Representations for information interchange — the international standard that defines every format covered on this page. iso.org
  2. Internet Engineering Task Force, RFC 3339, Date and Time on the Internet: Timestamps — the internet profile of ISO 8601 discussed in this guide. rfc-editor.org
  3. Week-date and ordinal-date examples calculated directly from the rules above for 31 August 2026 and cross-checked against the standard's Thursday-anchored week rule. Last reviewed August 2026.