fn:seconds-from-datetime function
The fn:seconds-from-dateTime function returns the seconds component of an xs:dateTime value that is in its localized form.
Syntax
- dateTime-value
- The dateTime value from which the seconds component is to be extracted.
dateTime-value is of type xs:dateTime, or is an empty sequence.
Returned value
If dateTime-value is of type xs:dateTime, the returned value is of type xs:decimal, and the value is greater than or equal to 0 and less than 60. The value is the seconds and fractional seconds component of dateTime-value.
If dateTime-value is an empty sequence, the returned value is an empty sequence.
Examples
The following function returns the seconds component of dateTime value for February 8, 2009 at 2:16:23 p.m. in the UTC-8 time zone.
fn:seconds-from-dateTime(xs:dateTime("2009-02-08T14:16:23-08:00"))
The returned value is 23.
The following function returns the seconds component of dateTime value for June 23, 2009 at 9:16:20.43 a.m. in the UTC time zone.
fn:seconds-from-dateTime(xs:dateTime("2009-06-23T09:16:20.43Z"))
The returned value is 20.43.