isIso8601DateTime.php
Table of Contents
Functions
- isIso8601DateTime() : bool
- Validates whether a string is a valid ISO 8601 date-time.
Functions
isIso8601DateTime()
Validates whether a string is a valid ISO 8601 date-time.
isIso8601DateTime(string $value[, bool $strict = false ]) : bool
Accepted shape:
- Date :
YYYY-MM-DD(extended) - Sep. :
T(mandatory in strict mode, space allowed otherwise) - Time :
HH:MM:SS, optionally with fractional seconds (.fff...) - Offset: optional
Z,±HH:MMor±HHMM
The function checks both the syntactic format and the calendar validity (February 30 is rejected, leap years are honored).
Parameters
- $value : string
-
The date-time string to validate
- $strict : bool = false
-
If true, the
Tseparator is mandatory (default: false)
Tags
Return values
bool —True if the string is a valid ISO 8601 date-time, false otherwise