ISO 8601 defines date and time formats. Some benefits include:
YYYY-MM-DD
, and for time
is hh:mm:ss.For an event with an offset from UTC, use YYYY-MM-DDThh:mm:ss±hh:mm
.
Never use a local date/time format for a non-local event. Instead, use
UTC, as in YYYY-MM-DDThh:mm:ssZ
(Z
is the only letter suffix).
The T
can be omitted where that would not cause ambiguity. For rfc
3339 compliance, it may be replaced by a space and for SQL, it must be
replaced by a single space.
Year 0000
is unrecognized by some formats (XML Schema, xs:date).