xs:gMonthDay

The primitive type xs:gMonthDay represents a recurring day of the year. It can be used to specify, for example, that your anniversary is on the 30th of July every year.

The lexical representation of xs:gMonthDay is --MM-DD. An optional time zone can be used, as described in "Time Zones" in Chapter 19. Table B-13 lists some values of this type.

Table B-13. Values of the xs:gMonthDay type

Values

Explanation

Valid

 
--05-03

May 3

--05-03Z

May 3, Coordinated Universal Time (UTC)

Invalid

 
--05-32

It must be a valid day of the year

05-03

The two leading hyphens are required

--5-3

The month and day must have two digits each

 

An empty value or zero-length string is not permitted

Values of xs:gMonthDay can be tested for equality (or inequality) with other values of the same type, but they cannot be compared using the operators <, <=, >, or >=.

Values of this type can be cast from the xs:date and xs:dateTime types. For example, the expression xs:date("2006-05-30") cast as xs:gMonthDay returns an xs:gMonthDay value of --05-30. They can also be cast to and from xs:string and xs:untypedAtomic.

Get XQuery 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.