Date Time ISO 8601 Format: How to Read and Extract It

Learn to read ISO 8601 date and time strings such as 2026-10-31T14:30:00Z, interpret offsets and variants, and extract them from text without altering their meaning.

ISO 8601 is the international standard for writing dates and times as text. A timestamp in this format, such as 2026-10-31T14:30:00Z, orders its parts from largest to smallest: year, month, day, hour, minute, second. Once you know what each character means, you can read any such string, convert it to your local time, and pull it out of logs, documents or data files without changing what it says.

What the ISO 8601 format does for your text

The format replaces ambiguous local conventions with one fixed layout. In US style, 10/11/2026 means October 11, but many other regions read it as 10 November. ISO 8601 writes October 11 as 2026-10-11 everywhere, so the meaning does not depend on the reader's location.

It takes a calendar date, a time of day, or both, and can add the time's relationship to Coordinated Universal Time (UTC). The result is a fixed-width string that sorts chronologically as plain text, provided every value uses the same layout and the same offset. That property is why the format is common in file names, databases, APIs and log files.

The parts of an ISO 8601 date-time string

The table below breaks down the example string 2026-10-31T14:30:45.250+03:00.

Part | Example | Meaning
YYYY | 2026 | Four-digit year
MM | 10 | Month, 01 to 12
DD | 31 | Day of the month, 01 to 31
T | T | Separator that marks the start of the time
hh | 14 | Hour on a 24-hour clock, 00 to 23
mm | 30 | Minutes, 00 to 59
ss | 45 | Seconds, 00 to 59
.sss | .250 | Optional decimal fraction of a second
±hh:mm or Z | +03:00 | Offset from UTC; Z means UTC itself

Leading zeros are required. March 5 is written 2026-03-05, not 2026-3-5. That fixed width keeps text sorting correct and makes pattern matching reliable.

How to read an ISO 8601 timestamp step by step

  • 1. Read the first ten characters as the date: year, month and day, separated by hyphens.
  • 2. Find the T. Everything after it is the time of day.
  • 3. Read hours, minutes and seconds on a 24-hour clock. For example, 14:30 is 2:30 PM.
  • 4. If a period or comma follows the seconds, read the digits after it as a fraction of a second. For example, .250 is a quarter of a second.
  • 5. Check the end of the string. A Z means the time is in UTC. A + or - followed by hours and minutes gives the local offset from UTC. If neither is present, the value is local time in an unstated time zone.
  • 6. To convert to UTC, subtract a positive offset or add a negative one.

Worked examples of time zone offsets

Each example below shows the original string and the same moment expressed in UTC. The conversions follow from the offset arithmetic in step 6.

2026-10-31T14:30:00Z        ->  2026-10-31T14:30:00Z   (already UTC)
2026-10-31T14:30:00+03:00   ->  2026-10-31T11:30:00Z   (subtract 3 hours)
2026-10-31T14:30:00-05:00   ->  2026-10-31T19:30:00Z   (add 5 hours)
2026-10-31T22:15:00-04:00   ->  2026-11-01T02:15:00Z   (crosses into the next day)

The last line shows that converting can change the date, and sometimes the month or year. When you compare or sort timestamps that carry different offsets, convert them all to UTC first. Sorting the raw strings works only when they share the same offset.

An offset is not a time zone name. -05:00 tells you how far the clock was from UTC at that moment. It does not identify a region, and a region's offset can change during the year because of daylight saving time. A string without any offset, such as 2026-10-31T14:30:00, cannot be placed on the UTC timeline unless you know the zone from context.

Variants you may encounter

  • Basic format: the same values without separators, such as 20261031T143000Z. It is common in file names and some calendar data.
  • Date only: 2026-10-31, with no time part.
  • Reduced precision: 2026-10-31T14:30 omits seconds. 2026-10 means the month as a whole.
  • Space instead of T: 2026-10-31 14:30:00Z. RFC 3339, a profile of ISO 8601 used by many internet protocols, permits a space for readability. A strict ISO 8601 parser may reject it.
  • Comma decimal: 14:30:45,250. ISO 8601 accepts a comma as the decimal sign, but many programming tools accept only a period.
  • Ordinal date: 2026-304, which means the 304th day of 2026, or October 31.
  • Week date: 2026-W44-6, which means ISO week 44, day 6 (Saturday), also October 31, 2026. ISO weeks start on Monday, and week 1 is the week that contains the year's first Thursday. Near January 1, the week-based year can therefore differ from the calendar year.

Extracting ISO 8601 dates from text

When you pull timestamps out of a larger text, the goal is to capture the whole string, including any fraction and offset. Losing the Z or the offset silently turns an exact moment into an ambiguous local time. The pattern below is an illustrative regular expression for the extended format. It has not been tested against a specific tool, so check it against your own data and your engine's syntax before relying on it.

\b(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:[.,](\d+))?)?(Z|[+-]\d{2}(?::?\d{2})?)?)?

The pattern checks shape only. It will also match impossible values such as 2026-13-45. Validate the captured parts afterward, or pass the matched string to a date-parsing library that rejects invalid dates.

Characters that can break matching or meaning

  • Look-alike dashes: text copied from word processors or web pages may contain an en dash (U+2013), a non-breaking hyphen (U+2011) or a minus sign (U+2212) in place of the ASCII hyphen-minus (U+002D). They look nearly identical, but a pattern that uses a plain hyphen will not match them.
  • The minus sign in offsets: ISO 8601 allows the true minus sign (U+2212) in negative offsets, while most software expects U+002D. Normalize these characters only when you have confirmed they represent a date separator or offset sign.
  • Invisible characters: a non-breaking space (U+00A0) or a zero-width space (U+200B) between the date and time can stop a match. Reveal them with a tool that displays invisible characters before you edit.
  • Case: the T and Z are normally uppercase. Some parsers also accept lowercase t and z, but do not assume yours does.
  • Edge values: 23:59:60 marks a leap second, and some producers write 24:00 for the end of a day. Many parsers reject one or both, so decide how to handle them before converting.

Verifying the result

  • Compare each extracted string with the source, character by character, including the fraction and the offset.
  • Confirm that every value with an offset converts to the UTC time you expect, especially near midnight and month boundaries.
  • Record whether values without an offset are local times. Do not label them as UTC.
  • If you reformat dates, run a sample through your tool and compare the output with a hand-converted version of the same sample.

Note on sources: this guide relies on general, verifiable features of ISO 8601 and RFC 3339. It does not cover how any particular application or library implements them, so confirm parser behavior, accepted variants and time zone handling in your tool's own documentation.