xs:gDay
The primitive type xs:gDay
represents a recurring day of the month. It can be used to specify, for example, that bills are sent out on the 15th of each month. It does not represent a number of days; to represent that, use the xs:dayTimeDuration
type instead.
The lexical representation of xs:gDay
is ---DD
, where DD
is a two-digit day number. An optional time zone may be used, as described in "Time Zones" in Chapter 19. Table B-11 lists some values of xs:gDay
.
Table B-11. Values of the xs:gDay type
Values |
Explanation |
---|---|
Valid | |
---04 |
The fourth of the month |
Invalid | |
---41 |
It must be a valid day of the month |
04 |
The three leading hyphens are required |
---4 |
It must have two digits |
An empty value or zero-length string is not permitted |
Values of xs:gDay
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:gDay
returns an xs:gDay
value of ---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.