Current epoch — epochtime.tools · A precision instrument for time

Why ISO 8601?

Before ISO 8601, every region had its own date format. Is 01/02/2025 January 2 or February 1? Depends on whether you're American or European, and the format gives no clue. ISO 8601 fixes this with a globally unambiguous syntax based on three principles: largest unit first, zero-padded, and explicit time zone offsets.

The core format

2025-01-01T14:30:00Z
└────────┘ └──────┘└┘
   date     time   tz

The three parts are separated by T. The Z at the end means UTC (it stands for "Zulu time"). Without a timezone marker, the value is local time and shouldn't cross system boundaries.

Date formats

FormExampleMeaning
Full calendar date2025-01-01January 1, 2025
Year and month only2025-01January 2025 (any day)
Year only2025The year 2025
Ordinal date2025-0011st day of 2025 (Jan 1)
Week date2025-W01-33rd day (Wed) of week 1 of 2025

Time formats

FormExampleMeaning
Hour, min, sec14:30:002:30 PM exact
Hour, min14:302:30 PM (no seconds)
With ms14:30:00.1232:30:00 and 123ms
With μs14:30:00.1234562:30:00.123456
Hour only142 PM, no minutes

Timezone designators

FormExampleMeaning
Z2025-01-01T14:30:00ZUTC
+HH:MM2025-01-01T14:30:00+05:305h 30m east of UTC (India)
-HH:MM2025-01-01T14:30:00-05:005h west of UTC (Eastern Time)
+HHMM2025-01-01T14:30:00+0530Same as +05:30
(none)2025-01-01T14:30:00Local time: ambiguous!

Durations

ISO 8601 also defines a syntax for durations using the P prefix:

P1Y          → 1 year
P1M          → 1 month
P1D          → 1 day
PT1H         → 1 hour
PT30M        → 30 minutes
PT15S        → 15 seconds
P1Y2M3DT4H5M6S → 1 year, 2 months, 3 days, 4h 5m 6s
P1W          → 1 week

The T separates date parts from time parts. M means "month" before T but "minute" after. This is the standard's main quirk.

Intervals

2025-01-01T00:00:00Z/2025-01-08T00:00:00Z   → start / end
2025-01-01T00:00:00Z/P1W                     → start / duration
P1W/2025-01-08T00:00:00Z                     → duration / end

Best practices

  • Always include the timezone designator (Z or offset). Local times can't be safely shared between systems.
  • Use UTC for storage. Convert to local time only when displaying to users.
  • Prefer extended format (2025-01-01T14:30:00Z) over basic format (20250101T143000Z): easier for humans to read.
  • Sortable as strings. ISO 8601 timestamps sort correctly with plain text comparison: "2025-01-01" < "2025-12-31" works.
  • Use it in JSON. The default for JSON.stringify(new Date()) in JavaScript is ISO 8601, which is exactly what you want.

RFC 3339: the subset you actually use

If "ISO 8601" feels overwhelming, here's the good news: RFC 3339 is a stricter profile of ISO 8601 that covers most real-world use. It requires:

  • Full extended-format date with hyphens: 2025-01-01
  • T as the date-time separator
  • Time with at least hours, minutes, seconds: 14:30:00
  • Either Z or a ±HH:MM offset

That's it. If you produce RFC 3339, you're guaranteed valid ISO 8601 too, and it's universally parseable.

Try it

Paste any ISO 8601 string into the main converter to see how it parses, what Unix timestamp it represents, and how it looks in other formats.

Last updated: