Contents

Programming Fundamentals › Programming Basics

ISO 8601

The standard text format for dates and times, like 2026-10-10T09:00:00Z.

Also known as: ISO 8601 date format, ISO date, RFC 3339

ISO 8601 is the standard text format for dates and times. It’s unambiguous, it sorts correctly as text, and every language can parse it.

2026-10-10                  a date
09:30:00                    a time
2026-10-10T09:30:00Z        date and time, in UTC ("Z" means zero offset)
2026-10-10T16:30:00+07:00   the same moment, with a +7 hour offset

The pattern is largest unit first: year, month, day, hour, minute, second. T separates date and time.

Why use it

  • 03/04/2026 could be March 4th or April 3rd. 2026-04-03 can’t be misread.
  • Strings in the same format sort in time order.
  • It’s the usual format for JSON APIs, logs and databases.
from datetime import datetime, timezone
datetime.now(timezone.utc).isoformat()    # e.g. '2026-10-10T09:30:00.123456+00:00'
datetime.fromisoformat("2026-10-10T09:30:00+00:00")
new Date().toISOString();                 // e.g. "2026-10-10T09:30:00.123Z"

Tips

  • Include the offset or Z. A time without one is ambiguous (time zones).
  • Send UTC between systems, and convert to local time only for display.
  • Dates without times (2026-10-10) have no zone. Don’t turn them into midnight UTC and then shift them.
  • Durations have their own form (PT90M is 90 minutes), but you’ll see it rarely.

See dates and times.