The primitive type xs:time
represents a specific time of day. The lexical representation of xs:time
is hh:mm:ss.sss
where hh
is the hour, mm
is the minutes, and ss.sss
is the seconds. XQuery implementations are required to support at least three fractional digits for the number of seconds, but may support more. To represent P.M. values, the hours 13 through 24 should be used. Either of the values 00:00:00
or 24:00:00
can be used to represent midnight. These values are considered identical, which means that 24:00:00
is considered less than 23:59:59
. A time zone can be added to the end, as described in "Time Zones" in Chapter 19.
Values of type xs:dateTime
can be cast to xs:time
, but the reverse is not true. This is described further in the section on xs:dateTime
. You can obtain the current time using the current-time
function, which returns a value of type xs:time
.
Table B-20 lists some values of the xs:time
type. For more information on working with times, see Chapter 19.
Table B-20. Values of the xs:time type
13.58.116.51