days-to-dateAdded by IBM on August 8, 2013 | Version 1 (Original)
|Determines the date based on the number of days that have passed since 1970-01-01. For example, days-to-date(-1) returns 1969-12-31.
Table 1. days-to-date parameter
|days||number||Any number. Positive numbers return dates after January 1, 1970. Negative numbers return dates before January 1, 1970. Fractional numbers are rounded up to the nearest whole number.|
A date that corresponds to January 1, 1970 plus the input number or an empty string if the input is NaN (not a number).
The following model might appear on a payment due billing form. The model contains a “number of days before payment due” element, a due date element, and a placeholder for the sum of today's date plus the “number of days”.
This model contains two calculations. The first determines the date on which payment is due, returned as the number of days, since January 1, 1971. The second calculation takes that number and turns it into the due date.
<xforms:bind calculate="days-from-date(now()) +
<xforms:bind calculate="days-to-date(../dueNumber)" nodeset="dueDate">