Converts a properly formatted date string (e.g., 03/12/1999) into either a date object, or the numeric value corresponding to the time for the specified date according to local time.
JSV_convertDateString(expS [, dateFormat])
expS.convertDateString([dateFormat])
The function convertDateString returns either a date object, or the numeric value corresponding to the time for the specified date according to local time.
The convertDateString function uses the following arguments.
Argument | Description |
expS | A string containing a date (e.g., 03/12/1999 or 3-12-1999). |
dateFormat |
Optional. Value that indicates whether the returned value is a date object,
or the numeric value corresponding to the time for the specified date according to local time.
Default is 0 which corresponds to the numeric value corresponding to the time for
the specified date according to local time.
0 - Numeric value corresponding to the time for the specified date according to local time 1 - Date object (e.g., Wed Mar 31 15:58:17 CST 1999) |
JSV_convertDateString
does not validate the input string.
You should use JSV_fsDate
to
ensure a valid date is passed to this function.
JSV_parseString, JSV_trimL, JSV_toDate
The following lines of code
var myDate = "04/15/1999";
document.write( "Numeric value: " + JSV_convertDateString(myDate) );
document.write( "Date object: " + JSV_convertDateString(myDate,1) );
produce
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.