ISO 8601 Parser
ISO 8601 Format Reference
Understand ISO 8601 Parser
Parses ISO 8601 dates, datetimes, durations, and intervals, and reports the day of week, week number, day of year, Unix timestamp, and relative time.
How it works
ISO 8601 orders fields from largest to smallest — 2024-06-15T10:30:00Z — which is why ISO strings sort correctly as plain text, a property no other common format has. The letter `T` separates the date from the time and matters more than it looks: `M` before the `T` means months and `M` after it means minutes, so P1M is one month and PT1M is one minute. The week number reported here follows the ISO rule that a week belongs to the year containing its Thursday, which is how 1 January can legitimately fall in week 52 of the previous year.
When to use it
- Checking an API timestamp that will not parse, usually because of a missing offset or a space where the `T` should be
- Reading an ISO 8601 duration out of a config file, a video manifest, or a Kubernetes field and turning it into something concrete
- Working out the ISO week number for a report that buckets data by week
- Confirming what a datetime with an unfamiliar offset such as `+05:45` resolves to in UTC
Watch out for
- A missing offset changes the meaning depending on the shape. JavaScript parses the date-only form `2024-06-15` as UTC midnight, but the datetime form `2024-06-15T10:30:00` with no `Z` and no offset as local time — the same "midnight" can differ by a day.
- Durations in years and months have no fixed length, so any conversion to seconds is an approximation. The total shown here assumes a 365-day year and a 30-day month; P1M is not 30 days in February.
- The `W` week designator in durations (P2W) is part of the standard but cannot be combined with other components, and this parser reads the Y/M/D/H/M/S form.
- `Z` and `+00:00` mean the same thing, but neither means "no timezone". A timestamp with no designator at all is a local time, which is a different value.
Frequently Asked Questions
What is ISO 8601 date format?
ISO 8601 is the international standard for representing dates and times. Basic date: 2024-01-15. Datetime with timezone: 2024-01-15T14:30:00Z (UTC) or 2024-01-15T14:30:00+05:30 (IST). Duration: P1Y2M3D. Used in JSON APIs, file timestamps, database fields, and HTML <time> elements.
What is the difference between Z and +00:00 in ISO 8601?
Both represent UTC. "Z" (Zulu) is shorthand for +00:00. They are interchangeable in all spec-compliant parsers. "Z" is more compact and common in APIs; "+00:00" is sometimes used to make the explicit offset visible.
How do I express a duration in ISO 8601?
P prefix, then years (Y), months (M), weeks (W), days (D), then T for time, then hours (H), minutes (M), seconds (S). Example: P1Y6M = 1 year 6 months. PT30M = 30 minutes. P2DT3H = 2 days 3 hours. Zero units may be omitted.
How to Use ISO 8601 Parser
- Paste or type your input in the input area above.
- The tool processes your input automatically or click Run.
- Copy or download the result using the action buttons.
- Use Ctrl+Enter to run quickly from the keyboard.