xs:dateTime
The xs:dateTime
type represents a specific moment in history, such
as 3:32 P.M., September 26, 2003. Date-times are written in the
form CCYY
-
MM
-
DD
T
hh
:mm
:ss
.
For example, 3:32 P.M., September 26, 2003 is written as 2003-09-26T15:32:00
. Decimal fractions
of a second can be indicated by appending a period and any number
of digits after the seconds. Dates in the far future and distant
past can be written with more than four digits in the year, but at
least four digits are required. Dates before year 1 are written
with a preceding minus sign. (There was no year 0.) An optional
time zone indicator in the form hh:mm
may be suffixed to provide a time zone as an offset from
Coordinated Universal Time (Greenwich Mean Time, UTC). For
example, 2003-09-26T15:32:00-05:00
is 3:32 P.M.,
September 26, 2003 in the U.S. Eastern time zone. A Z
can be used instead to indicate UTC.
These are all valid values of type xs:dateTime
:
2001-01-01T03:32:00-05:00
1999-12-31T00:00:00Z
2002-12-23T17:08:30.121893632178
Constraining facets that apply to xs:dateTime
are minInclusive
, maxInclusive
, minExclusive
, maxExclusive
, pattern
, enumeration
, and whiteSpace
. Note, however, that when the
time zone is not specified, it's not always possible to
unambiguously determine whether one time falls after
another.