This section provides a summary of all date, time and duration related built-in datatypes: dateTime, dateTimeStamp, date, time, gYear, gMonth, gDay, gYearMonth, gMonthDay, duration, yearMonthduration and dayTimeduration.
XSD 1.1 supports 12 date, time and duration related built-in datatypes:
"dateTime", "dateTimeStamp", "date", "time", "gYear", "gMonth", "gDay", "gYearMonth", "gMonthDay",
"duration", "yearMonthduration" and "dayTimeduration".
They are defined using data models similar to "ISO 8601 - Data elements and interchange formats" standard.
Here is a summary of all of them.
1. "dateTime" datatype contain 7 properties:
"year", "month", "day", "hour", "minute", "second" and "timezoneOffset" with their own lexical representation rules:
"year" - Same as "int" with 0 padded minimum 4 digits.
"month" - 2-digit from "01" to "12".
"day" - 2-digit from "01" to "31".
"hour" - 2-digit from "00" to "23".
"minute" - 2-digit from "00" to "59".
"second" - Same as "decimal" starting from 00.0" and less than "60.0"
"timezoneOffset" - Pattern of /Z|((+|-)\d\d:\d\d)/.
2. "dateTime" and related datatype lexical representation rules can be expressed using
the "dateTime" 7-property model:
3. "duration" datatype contain 7 different properties:
"duSign", "duYear", "duMonth", "duDay", "duHour", "duMinute" and "duSecond"
with their own lexical representation rules:
"duSign" - Pattern of /-?/. "+" is not allowed.
"duYear" - Pattern of /(int)Y/. (int) must have no sign.
"duMonth" - Pattern of /(int)M/. (int) must have no sign.
"duDay" - Pattern of /(int)D/. (int) must have no sign.
"duHour" - Pattern of /(int)H/. (int) must have no sign.
"duMinute" - Pattern of /(int)M/. (int) must have no sign.
"duSecond" - Pattern of /(decimal)M/. (decimal) must have no sign.
4. "duration" and related datatype lexical representation rules can be expressed using
the "duration" 7-property model: