XSD datatype
xs:date
A calendar date, zero-padded, with an optional timezone that almost nobody expects it to have.
xs:date is YYYY-MM-DD, with the same zero-padding requirement as xs:dateTime and the same real-calendar validation.
It also accepts a timezone: '2026-08-18Z' and '2026-08-18+02:00' are both valid dates. That surprises people, and it means a date can denote different 24-hour windows depending on the offset.
- Lexical space
- YYYY-MM-DD with an optional Z or ±hh:mm.
- Derives from
- Primitive type
- Category
- Date and time types
- Facets
- minInclusive, maxInclusive, minExclusive, maxExclusive, pattern, enumeration, whiteSpace
What validates
Every literal below is put through the schema validator on each test run, against the schema at the foot of this page.
2026-08-182026-08-18Z2026-08-18+02:002024-02-29
What does not
2026-8-18Both month and day must be two digits.
18-08-2026The order is year, month, day.
2026-02-30No such date.
2025-02-292025 is not a leap year.
The schema used
This is the exact schema the literals above are validated against. Paste it into the validator with one of them to see the result yourself.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="v" type="xs:date"/>
</xs:schema>Related
- xs:dateTimeA date and time in ISO 8601 form, requiring the T separator and zero-padding. Timezone is optional, which causes more trouble than it saves.
- xs:timeA time of day, seconds mandatory, with 24:00:00 legal and 24:00:01 not.
- xs:gYear and friendsGregorian fragments — a year, a month, a day, or a pair of them — for the dates that are genuinely partial.
Get started
Bring order to the XML your team can't afford to ignore.
Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.