Returns time equivalent of a date/time string, in milliseconds.

Syntax

Date.parse(<date expC>)

<date expC>

The date/time string you want to convert.

Property of

Date

Description

The parse( ) method returns the number of milliseconds since January 1, 1970 00:00:00 GMT for the specified date/time string, defaulting to the operating system’s current time zone setting. For example, if the time zone is currently set to United States Eastern Standard Time, which is five hours behind GMT, then Date.parse( "Sep 14 1995 11:20" ) yields a time which is equivalent to 16:20 GMT.

The string may be in any of the forms acceptable to the Date class constructor, as described under class Date. In contrast, the UTC( ) method uses numeric parameters for each of the date and time components and assumes GMT as the time zone.

Because parse( ) is a static class method, you call it via the Date class, not a Date object.