days-to-date()

string days-to-date(number)

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

  1. The number parameter is rounded to the nearest whole number.
  2. The result is interpreted as the difference between the desired date and 1970-01-01.
  3. An input parameter value of NaN results in output of the empty string.

Examples:

days-to-date(11688)

returns 2002-01-01

days-to-date(-1)

returns 1969-12-31

More examples