seconds-from-time function

The fn:seconds-from-time function returns the seconds component of an xs:time value.

Syntax

Read syntax diagramSkip visual syntax diagramfn:seconds-from-time( time-value)
time-value
The time value from which the seconds component is to be extracted.

time-value is of type xs:time, or is an empty sequence.

Returned value

If time-value is of type xs:time, the returned value is of type xs:decimal, and the value is greater than or equal to zero and less than 60. The value is the seconds and fractional seconds component of time-value.

If time-value is an empty sequence, the returned value is an empty sequence.

Example

The following function returns the seconds component of the time value for 08:59:59 am in the UTC-8 time zone.

fn:seconds-from-time(xs:time("08:59:59-08:00"))

The returned value is 59.