Data & Formatting · In-Browser Regular Expression Lab
ISO 8601 DateTime Regex — Full UTC and Timezone Offset Formats
Matches ISO 8601 timestamps like 2026-10-14T22:30:00.000Z or with +/- timezone offsets.
Flags:
//none
Match Found
Load Sample:
Match Inspection & Details1 match
Match #1:2026-10-14T22:30:00Z
Test Samples Verification Matrix
Expected Valid Samples (Should Match)
2026-10-14T22:30:00Z Pass
2026-10-14T15:00:00.123+01:00 Pass
2024-01-01T00:00:00.000Z Pass
Expected Invalid Samples (Must Reject)
2026-10-14 22:30:00 Rejected (Pass)
2026-10-14T22:30:00 Rejected (Pass)
2026-10-14T25:00:00Z Accepted (Fail)
Code Implementation Generator
// JavaScript / TypeScript (ES6+)
const pattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/;
const text = "2026-10-14T22:30:00Z";
const isMatch = pattern.test(text);
console.log("Is Match:", isMatch);
if (isMatch) {
const matches = text.match(pattern);
console.log("Matches:", matches);
}Regular Expression Token Breakdown
Matches complete calendar date, literal 'T', time, optional fractional milliseconds, and UTC 'Z' or offset. Each component of the regular expression serves a distinct syntactical purpose as mapped below:
| Token Pattern | Name / Component | Function & Rule |
|---|---|---|
| \d{4}-\d{2}-\d{2} | Date | Year, month, and day. |
| T | Separator | ISO date-time delimiter. |
| \d{2}:\d{2}:\d{2} | Time | Hours, minutes, seconds. |
| (?:\.\d+)? | Milliseconds | Optional fractional seconds. |
| (?:Z|[+-]\d{2}:\d{2}) | Timezone | UTC marker 'Z' or explicit offset like +02:00. |
Frequently Asked Questions
Is JavaScript Date.prototype.toISOString() output compliant?
Related Regular Expressions
Browse All 40 PatternsData & Formatting
ISO Date (YYYY-MM-DD)
Validates 4-digit year, 2-digit month (01-12), and 2-digit day (01-31) in ISO format.
/^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$/Test regex
Data & Formatting
24-Hour Time Format (HH:mm:ss)
Matches 24-hour military and standard timestamps in HH:mm or HH:mm:ss format.
/^(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?$/Test regex
Data & Formatting
5-Field Cron Expression
Matches standard Unix crontab schedules (minute, hour, day of month, month, day of week).
/^(?:\*(?:\/[0-9]+)?|[0-9,-\/]+)\s+(?:\*(?:\/[0-9]+)?|[0-9,-\/]+)\s+(?:\*(?:\/[0-9]+)?|[0-9,-\/]+)\s+(?:\*(?:\/[0-9]+)?|[0-9,-\/]+|[a-zA-Z]{3})\s+(?:\*(?:\/[0-9]+)?|[0-9,-\/]+|[a-zA-Z]{3})$/Test regex