Note: This section contains implementation-specific behavior that can be inconsistent across implementations.
If IPOdate
is an existing Date
object, it can be set to August 9, 1995 (local time) as follows:
IPOdate.setTime(Date.parse('Aug 9, 1995'));
Some other examples of parsing non-standard date strings:
Date.parse('Aug 9, 1995');
Returns 807937200000
in time zone GMT-0300, and other values in other time zones, since the string does not specify a time zone and is not ISO format, therefore the time zone defaults to local.
Date.parse('Wed, 09 Aug 1995 00:00:00 GMT');
Returns 807926400000
no matter the local time zone as GMT (UTC) is provided.
Date.parse('Wed, 09 Aug 1995 00:00:00');
Returns 807937200000
in time zone GMT-0300, and other values in other time zones, since there is no time zone specifier in the argument and it is not ISO format, so is treated as local.
Date.parse('Thu, 01 Jan 1970 00:00:00 GMT');
Returns 0
no matter the local time zone as a time zone GMT (UTC) is provided.
Date.parse('Thu, 01 Jan 1970 00:00:00');
Returns 14400000
in time zone GMT-0400, and other values in other time zones, since no time zone is provided and the string is not in ISO format, therefore the local time zone is used.
Date.parse('Thu, 01 Jan 1970 00:00:00 GMT-0400');
Returns 14400000
no matter the local time zone as a time zone GMT (UTC) is provided.