Converts the passed month, day and year arguments into a a JavaScript date object.

Syntax

JSV_toDate(inMonth, inDay, inYear)

Prototype

n/a

Returns

The toDate function returns a JavaScript date object created from inMonth, inDay, and inYear.

Parameters

The toDate function uses the following arguments.

Argument Description
inMonth The month to be set. Valid months include:
  • 0 - January
  • 1 - February
  • 2 - March
  • 3 - April
  • 4 - May
  • 5 - June
  • 6 - July
  • 7 - August
  • 8 - September
  • 9 - October
  • 10 - November
  • 11 - December
inDay The date (i.e., day of the month) to be set (e.g., 17).
inYear The year to be set. The toDate function supports the input of a four-digit year.

Remarks

n/a

Dependencies

n/a

Example

The following lines of code

document.write( "1-1-1999 is " + JSV_toDate(0, 1, 1999) );
document.write( "1-1-2000 is " + JSV_toDate(0, 1, 2000) );
document.write( "1-1-2002 is " + JSV_toDate(0, 1, 2002) );

produce