The primitive type xs:gYear
represents a specific year. The lexical representation of xs:gYear
is YYYY
. A preceding minus sign (−) can be used to represent years before 0001. An optional time zone may be used, as described in "Time Zones" in Chapter 19. Table B-14 lists some values of the xs:gYear
type.
Values of xs:gYear
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:gYear
returns an xs:gYear
value of 2006
. They can also be cast to and from xs:string
and xs:untypedAtomic
.
3.149.28.126