Name

xs:gYearMonth

Facets

xs:enumeration, xs:maxExclusive, xs:maxInclusive, xs:minExclusive, xs:minInclusive, xs:pattern, xs:whiteSpace

The xs:gYearMonth type stores a year/month combination in the format CCYY-MM, where CC is the century, YY is the year (00–99), and MM is the month (01–12). The overall year must include at least four digits and may have a preceding negative sign. Acceptable year/month combinations include 1970-11, 0044-03, and 0801-04.

A time zone relative to Coordinated Universal Time, also known as Greenwich Time or UTC, may also be added. If there is a time zone, the format is ±hh:mm, wherein a plus or minus sign is followed by a two-digit value for hours, then a colon, and then a two-digit value for minutes. You can also use Z in place of the time zone, indicating UTC. Valid xs:gYearMonth values with a time zone include 1970-11+05:00, 0044-03-10:30, and 0801-04Z.

Get XML Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.