[Webkit-unassigned] [Bug 80262] REGRESSION (r76714): Date.toLocaleString not taking time zone into account

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 7 19:46:36 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=80262


Gavin Barraclough <barraclough at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID




--- Comment #10 from Gavin Barraclough <barraclough at apple.com>  2012-03-07 19:46:36 PST ---
Ugh, my bad, missed the -0:14:44 in Eli's comment.  Had considered historic timezones, but had incorrectly assumed an odd shift like that was more likely a math bug!

> > var TIME_1900 = -2208988800000;
> undefined
> > new Date(TIME_1900).toTimeString()
> 01:00:00 GMT+0100 (CET)
> > new Date(TIME_1900).toLocaleTimeString()
> 11:45:16 PM GMT-00:14:44

Per the spec, toLocaleTimeString is implementation defined, so 'correct' is ambiguous, but per common sense this is actually a progression.  At midnight UTC, 1st Jan 1900, in Madrid it was 11:45:16pm, of Dec 31 1899.  The spec defined time conversions are restricted from using historic information, but the locale methods are not, and are free to actually be correct. :-)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list