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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access