The seconds-to-dateTime() Function

Release 2.0 - ...

Syntax

  CopyCode image Copy Code
string seconds-to-dateTime(number)

Description

This function returns a string containing a lexical xsd:dateTime that corresponds to the number of seconds passed as the parameter according to the following rules:

  • The number parameter is rounded to the nearest whole number, and the result is interpreted as the difference between the desired UTC dateTime and 1970-01-01T00:00:00Z.
    An input parameter value of NaN results in output of the empty string.
    This function does not support leap seconds.

Example

XML CopyCode image Copy Code
<xforms:output value="seconds-to-dateTime(0)">
   <xforms:label>seconds-to-dateTime : </xforms:label>
</xforms:output>

The above example returns "1970-01-01T00:00:00Z".

Specification

Link to the XForms specification: the seconds-to-dateTime() function.