1

Here are two examples for dates typed into Chrome's Developer Tools console:

new Date(-1641003640000)
Mon Dec 31 1917 23:39:20 GMT+0200 (Israel Standard Time)

Add 1 millisecond:

new Date(-1641003640001)
Mon Dec 31 1917 23:59:59 GMT+0220 (Israel Standard Time)

Note the change in timezone to GMT+0220 and the change in seconds from 20 to 59, which can not be correct for a 1 milliseond change.

So, why does the Javascript engine change the timezone from GMT+0200 (which is correct) to an invalid GMT+0220 timezone?

Comment

It seems to be a Chrome bug. The same code works correctly in Firefox:

new Date(-1641003640000)
Date Mon Dec 31 1917 23:39:20 GMT+0200 (Israel Standard Time)

new Date(-1641003640001)
Date Mon Dec 31 1917 23:39:19 GMT+0200 (Israel Standard Time)
Dror
  • 1,406
  • 12
  • 15
  • 2
    [This site](https://www.timeanddate.com/time/zone/israel/jerusalem?syear=1900) mentions a timezone change on January 1st 1918 where it went from `UTC +2:20:40` to `UTC +2:00:00`. I suspect that has something to do with it. – Ivar Jul 16 '20 at 12:25
  • As of ECMAScript 2018 (ed. 9) Implementations are required to observe "*local political rules for standard time and daylight saving time in effect at \[the specified date and time\] should be used to determine*" local timezone adjustment (offset), see [*ECMA-262 §2.4.1.7*](https://tc39.es/ecma262/#sec-local-time-zone-adjustment). – RobG Jul 17 '20 at 03:19

0 Answers0