epochkit

ISO 8601 Converter

Convert between ISO 8601 variants and Unix timestamps. Extended, basic, week date, and ordinal — all with timezone support.

Extended (most common)

2026-05-11T02:00:08+00:00

yyyy-MM-ddTHH:mm:ssZ — RFC 3339 compliant

Basic

20260511T020008+0000

yyyyMMddTHHmmssZ — compact, no separators

Week date

2026-W20-1

yyyy-Www-D — ISO week numbering

Ordinal date

2026-131

yyyy-DDD — day of year (001–366)

Unix (seconds)

1778464808

seconds since epoch

Press 15 to copy a format • N for now

Format reference

Variant Pattern
Extended (date + time) yyyy-MM-dd'T'HH:mm:ssZ
Extended (date only) yyyy-MM-dd
Basic (date + time) yyyyMMdd'T'HHmmssZ
Week date yyyy-'W'ww-E
Ordinal date yyyy-DDD
Time only HH:mm:ss

How to use

1

Pick a date and time

Use the date, time, and timezone inputs. All five ISO 8601 variants update automatically.

2

Choose your variant

Extended format is the most compatible. Use basic for compact storage, week date or ordinal for specialized systems.

3

Copy and use

Click any card to copy. Paste into your API, database query, or code. The Unix seconds card is always included for cross-format conversion.

Common pitfalls

Z and +00:00 are not string-equal

2026-05-09T18:00:00Z and 2026-05-09T18:00:00+00:00 represent the same moment but are different strings. String comparison will fail. Always parse before comparing.

Date-only strings are UTC, datetime strings without offset are local

In JavaScript, new Date("2026-05-09") gives midnight UTC. But new Date("2026-05-09T00:00:00") gives midnight local time. The two can differ by hours. Always include a timezone offset.

Fractional seconds precision varies

ISO 8601 allows fractional seconds (.SSS, .SSSSSS, etc.). Some APIs return milliseconds, others microseconds. If you store and retrieve from a database, ensure your parser handles varying precision, or truncate to the precision you need.

ISO week 1 is not always the first week of the year

ISO week numbering means January 1 can be in week 52 or 53 of the previous year. 2026-01-01 is in week 1 of 2026, but 2025-01-01 was in week 1 of 2025 (a Wednesday). Always use the ISO week year, not the calendar year, when working with week dates.

ISO 8601 and RFC 3339 in production APIs

ISO 8601 is not a single format — it is a family of representations. The one you almost certainly want for API work is the extended datetime format with a UTC offset: 2026-05-09T18:00:00Z. This is also the form mandated by RFC 3339, which is what JSON APIs, HTTP headers, and OpenAPI specifications refer to when they say "ISO 8601 date."

The basic format (20260509T180000Z) omits all separators. It is rarely seen in APIs but appears in some calendar standards (iCalendar, vCard) and some legacy EDI systems. The week date ( 2026-W19-6) and ordinal date ( 2026-129) are even more niche — useful when your system's natural time unit is a calendar week or day-of-year, such as in logistics, broadcasting, and some financial reporting contexts.

For maximum compatibility across databases (PostgreSQL, MySQL, SQLite), languages, and cloud services: store timestamps as Unix integers (seconds) in your backend, and format them as extended ISO 8601 at the API boundary. This decouples storage precision from display format and avoids the many edge cases that arise from storing human-readable strings.

Frequently asked questions

What is ISO 8601?
ISO 8601 is an international standard published by the International Organization for Standardization that defines how to represent dates, times, and intervals. It is the basis for many API specifications, database formats, and the RFC 3339 profile used in internet protocols. The extended format — 2026-05-09T18:00:00Z — is the most widely used variant.
What is the difference between ISO 8601 and RFC 3339?
RFC 3339 is a profile of ISO 8601 that is stricter in several ways: it always requires a timezone designator, uses only the extended (hyphenated) format, and prohibits week dates and ordinal dates. Most internet APIs and the HTML <input type="datetime-local"> element use RFC 3339. If someone says "ISO 8601 date," they usually mean RFC 3339.
What does the Z at the end of a timestamp mean?
The "Z" is the UTC timezone designator, short for "Zulu time" from the NATO phonetic alphabet. 2026-05-09T18:00:00Z is equivalent to 2026-05-09T18:00:00+00:00. Some systems accept only Z while others accept +00:00 — they are semantically identical, but a string comparison will not match them.
What happens if I omit the timezone offset in an ISO 8601 string?
The behavior is implementation-defined and differs across languages. JavaScript's Date.parse() treats a date-only string (2026-05-09) as UTC, but a datetime string without a timezone (2026-05-09T18:00:00) as local time — a common source of off-by-hours bugs. Always include a timezone designator when representing an absolute point in time.
What is a week date in ISO 8601?
ISO 8601 defines a week-based calendar where weeks start on Monday. The first week of the year (W01) is the week containing the first Thursday of the year. The format is YYYY-Www-D, where ww is the week number (01–53) and D is the day of week (1 = Monday, 7 = Sunday). Week dates are used in some European business contexts.

Learn more

Other tools you might find useful