Dates & Timesflags: g

ISO 8601 Date-Time

Match full ISO 8601 date-times with timezone offset or Z suffix (e.g. 2024-01-15T14:30:00Z).

Try it in RegexPro

Pattern

regexJavaScript
/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+\-]\d{2}:?\d{2})/g

Raw source: \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+\-]\d{2}:?\d{2})

How it works

Date YYYY-MM-DD, literal T, time HH:MM:SS, optional fractional seconds, then either Z or a ±HH:MM / ±HHMM offset.

Examples

Input

2024-01-15T14:30:00Z

Matches

  • 2024-01-15T14:30:00Z

Input

2024-03-01T09:00:00.123+05:30

Matches

  • 2024-03-01T09:00:00.123+05:30

Input

2024-01-15

No match

Common use cases

  • API response parsing
  • Structured log ingestion
  • Audit event timestamp extraction
  • Cross-timezone analytics