2009/9/9 Flier Lu <[email protected]>: > > ECMA-262 defined a Date.parse method to convert a string to a number > > In the current implementation (v1.3.9), the result like > >> Date.parse("1970.1.0") > NaN >> Date.parse("1970.1.1") > -28800000 >> Date.parse("1970.1.2") > 57600000 > > On the other hand, the result of Date.parse("1970.1.1") is NaN in IE 8 > and firefox 3.5.2. > > I'm not sure whether it is a design issue or bug? > > 15.9.4.2 Date.parse (string) > The parse function applies the ToString operator to its argument and > interprets the resulting string > as a date; it returns a number, the UTC time value corresponding to > the date. The string may be > interpreted as a local time, a UTC time, or a time in some other time > zone, depending on the contents > of the string.
The standard is quite vague here. We would normally try to match the behaviour of Safari in such cases. -- Erik Corry, Software Engineer Google Denmark ApS. CVR nr. 28 86 69 84 c/o Philip & Partners, 7 Vognmagergade, P.O. Box 2227, DK-1018 Copenhagen K, Denmark. --~--~---------~--~----~------------~-------~--~----~ v8-users mailing list [email protected] http://groups.google.com/group/v8-users -~----------~----~----~----~------~----~------~--~---
