Adobe acrobat forms javascript object specification User Manual

Page of 64
Acrobat Forms - JavaScript Object Specification
55
scand
Parameters: cFormat, cDate
Returns: date object
This method converts the supplied date, cDate, into a JavaScript date object according to rules
of the supplied format string, cFormatcFormat uses the same syntax as found in
This
routine is much more flexible than using the date constructor directly.
/* Turn the current date into a string. */
var cDate = util.printd("mm/dd/yyyy", new Date());
console.println("Today’s date: " + cDate);
/* Parse it back into a date. */
var d = util.scand("mm/dd/yyyy", cDate);
/* Output it in reverse order. */
console.println("Yet again: " + util.printd("yyyy mmm dd", d));
Note:
Given a two digit year for input,
resolves the ambiguity as follows: if
the year is less than 50 then it is assumed to be in the 21st century (i.e. add
2000), if it is greater than or equal to 50 then it is in the 20th century (add
1900). This heuristic is often known as the 
Date Horizon.
4.0