seconds-from-dateTimeAdded by IBM on August 8, 2013 | Version 1 (Original)
|Determines how many seconds difference there is between 1970-01-01 and the provided date.
Table 1. seconds-from-datetime parameter
|dateTime||xsd:dateTime||A date and time written in the following format:
Note that the dateTime must include the dashes and colons. For example, June 21, 2005 at 4:55 PM Central Daylight Savings Time would be written as:
- yyyy is a four digit year, such as 2005.
- mm is a two digit month, such as 02 or 10.
- dd is a two digit day, such as 05 or 22.
- T is the time separator. You must include this.
- hh is a two digit hour (24 hour clock), such as 02 or 18.
- mm is a two digit minute, such as 03 or 55.
- ss is at least a two digit second, such as 08 or 43. The seconds value may also include a decimal fraction.
- Z is the timezone indicator. For no timezone adjustment, simply append Z to the string. To make a timezone adjustment, replace the Z with the following expression:
(+ | -) hh:mm
- hh is a two digit hour (24 hour clock).
- mm is a two digit minute.
Returns A number representing the number of seconds, or NaN if the input does not match the allowed format.
Example The following example shows an XForms model and a button item:
The model contains data elements that record when the form is first opened, when the form is submitted, and the elapsed time between the two. When the XForms model is first ready, an xforms:setvalue function is triggered in the model and records the time the form was opened. When the user clicks the submit button, an xforms:setvalue action is triggered in the button and records the time the form was submitted. The change in value also causes the xforms:bind to update, which calculates the elapsed time by converting both times into seconds, subtracting the timeOpened from the timeSubmitted, and then dividing by 60 to convert the result to minutes.
<xforms:instance id="timeData" xmlns="">
seconds-from-dateTime(../timeOpened)) div 60"/>