Extracts the number of days from the days component of $dayTimeDuration-var.
If the value of $dayTimeDuration-var is the empty sequence, the empty sequence is returned. The empty sequence is a sequence containing zero items (), which is similar to null in SQL.
xf:get-days-from-dayTimeDuration(xf:dayTimeDuration? $dayTimeDuration-var) —> xs:integer?
Contains a representation of a time duration which can contain days, hours, minutes, and seconds. |
Returns the number of days as an integer from days component of $dayTimeDuration-var.
<days>{xf:get-days-from-dayTimeDuration(xf:dayTimeDuration("P7DT25H8M20S"))}</days>
The preceding query generates the following result:
<days>7</days>
Note: Even though 25 hours is specified in the hours component (25H) of the dayTimeDuration creation string (adding up to an additional day), only 7 days are returned as originally specified by the days component (7D).
<days>{xf:get-days-from-dayTimeDuration(xf:dayTimeDuration("-PT4D"))}</days>
The preceding query generates the following result:
<days>-4</days>
<days>{xf:get-days-from-dayTimeDuration(xf:dayTimeDuration("PT2H20S"))}</days>
The preceding query generates the following result:
<days>0</days>
W3C get-days-from-dayTimeDuration function description.
W3C dayTimeDuration data type description.