Scand - Adobe ACROBAT FORMS JAVASCRIPT OBJECT Specification

Adobe acrobat version 4.0
Table of Contents

Advertisement

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, cFormat. cFormat uses the same syntax as found in printd. 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,
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.
Acrobat Forms - JavaScript Object Specification
scand
resolves the ambiguity as follows: if
4.0
55

Advertisement

Table of Contents
loading

This manual is also suitable for:

Acrobat forms javascript object specification

Table of Contents