XFA Specification
Chapter 23, FormCalc Specification
Date And Time Built-in Functions
843
Date2Num()
This function returns the number of days since the
epoch,
given a date string.
Syntax
Date2Num(d1[, f1[, k1]])
Parameters
d1
is a date string in the format given by f1, governed by the locale given by k1.
f1
is a
date picture clause.
If f1 is omitted, the
default picture clause
is used.
k1
is a locale identifier string, as described in
“Specifying a Locale (Locale Identifier String)” on
page 828.
If k1 is omitted, the
prevailing locale
is used.
Returns
The days since the
epoch
or null if any of its parameters are null.
If the given date is not in the format given, or the picture clause is invalid, or the locale is invalid, the
function returns 0.
Sufficient information must be provided to determine a unique day since the epoch: if any of the day of
the year and year of the era are missing, or any of the day of the month, month of the year and year of the
era are missing, the function returns 0.
Examples
Calling Date2Num as follows …
Date2Num("Mar 15, 1996")
Date2Num("1/1/1900", "D/M/YYYY")
Date2Num("03/15/96", "MM/DD/YY")
Date2Num("Aug 1,1996", "MMM D,YYYY")
Date2Num("31-ago-96", "DD-MMM-YY", "es_ES")
Date2Num
("1/3/00", "D/M/YY") - Date2Num("1/2/00", "D/M/YY")
Returns
35138
1
35138
35277
35307
29, year 2000 being a leap year!
See Also
Num2Date()
and
DateFmt()
Home Index Bookmark Pages
Pages: Home Index All Pages