Extracts the seconds from $time-var.
If the value of $time-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-seconds-from-time(xs:time? $time-var) —> xs:decimal?
Returns the seconds as an decimal from $time-var.
The following is a simple example using the get-seconds-from-time function:
<seconds>{xf:get-seconds-from-time("22:21:01")}</seconds>
The preceding query generates the following result:
<seconds>1</seconds>
The following example uses the get-seconds-from-time function with a timezone:
<seconds>{xf:get-seconds-from-time("14:21:01-05:00")}</seconds>
The preceding query generates the following result:
<seconds>1</seconds>
W3C get-seconds-from-time function description.
W3C time data type description.