XSD Data TypesLesson 99Free preview
XSD Date/Time
This lesson is part of XML · All levels
Summary
XML Schema has specific date and time types: xs:date, xs:time, xs:dateTime, xs:duration, as well as xs:gYear and its derivatives. The writing must comply with ISO 8601, e.g. 2026-10-23 for the date and 2026-10-23T09:30:00 for the dateTime. The time limit is set with the minInclusive and maxInclusive facets, while the time zone is written with the Z-shaped or offset +07:00.
Key points
- The date format is in accordance with ISO 8601: YYYY-MM-DD
- xs:dateTime combines date and time with a T-space
- xs:duration using the PnYnMnDTnHnMnS pattern, examples P3D and PT2H30M
- Time zone written with the letter Z or offset +07:00
- Facet minInclusive and maxInclusive work in chronological order
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.