The xs:dayTimeDuration
type is a restriction of the xs:duration
type, with only day (D
), hour (H
), minute (M
), and second (S
) components allowed. Its lexical representation is PnDTnHnMnS
, where an uppercase P
starts the expression, n
indicates the quantity of each component, and an uppercase letter T
separates the day and time components. For example, the value P3DT5H
represents a period of three days and five hours. You can omit components whose quantity is zero, but at least one component is required.
All of the lexical rules for xs:duration
also apply to the xs:dayTimeDuration
type. This includes allowing a negative sign at the beginning of the value. Table B-6 lists some values of the xs:dayTimeDuration
type.
In previous versions of XQuery (including the Candidate Recommendation), dayTimeDuration
was prefixed with xdt:
instead of xs:
because it was in a different namespace. Some processors still support the previous namespaces for these types instead.
Unlike the xs:duration
type, the xs:dayTimeDuration
type is totally ordered, meaning that its values can be compared using the operators <
, >
, <=
, and >=
. For more on working with durations, see Chapter 19.
Table B-6. Values of the xs:dayTimeDuration type
3.141.197.251