Skip to main content
AllDevToolsHub
Back to all patterns

ISO 8601 Datetime with UTC Z

Dates & Numbers

Matches an ISO 8601 datetime in UTC (Z suffix).

/^[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])T(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?Z$/

How it works

Date YYYY-MM-DD, T separator, time HH:MM:SS with optional fractional seconds, Z for UTC. Does not validate February days (29 vs 28) or leap years, beyond regex's scope.

Test Cases

Should Match

  • 2026-05-24T12:34:56Z
  • 2024-02-29T00:00:00.123Z

Should NOT Match

  • 2026-05-24T12:34:56
  • 2026-13-01T00:00:00Z

Quick Summary

Matches strict ISO 8601 UTC datetimes (with trailing Z).