Time difference between chrome / edge on windows 10
I am getting TZ difference on windows 10 between Chrome and Edge. When I run this code in the console:
> var date = new Date(2013, 2, 29, 1, 0, 0, 0);
> date
This will be the exit when working on Edge
> [date] Fri Mar 29 2013 01:00:00 GMT+0200 (Jerusalem Standard Time)
While this will be output in Chrome:
> [date] Fri Mar 29 2013 01:00:00 GMT+0300 (Jerusalem Daylight Time)
It seems to be recognized as DST in Chrome, but in Edge it is not, it is correct.
( Attached screenshot )
If I turn off the "Set for daylight hours automatically" setting, the Chrome date will be the same. ( image2 )
Can someone explain why? and how to get the correct TZ in chrome in any "Date and Time" configuration?
Edge version: 20.10240.16384.0 Chrome version: 56.0.2924.75 (64-bit)
source to share
It really seems like a bug.
# As of 2013, DST starts at 02:00 on the Friday before the last Sunday
# in March. DST ends at 02:00 on the last Sunday of October.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D
Rule Zion 2013 max - Oct lastSun 2:00 0 S
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Jerusalem 2:20:54 - LMT 1880
2:20:40 - JMT 1918 # Jerusalem Mean Time?
2:00 Zion I%sT
Therefore, in 2013 DST must start on Friday before the last Sunday in March, which was March 29 (the previous Friday was March 22, which does not follow the rule Fri>=23
in the time zone data.) This date is also confirmed by timeanddate.com .
On Windows, the data seems to be correct. Examining the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\Israel Standard Time\Dynamic DST
The last part highlighted in green is the DST start date.
00 00 = Year (ignored)
03 00 = Month (March)
05 00 = Day of week (Friday)
05 00 = Day number (5 = last)
02 00 = Hour (02:00)
00 00 = Minute
00 00 = Second
00 00 = Millisecond
So Windows and IANA data points to the same date. But somehow Chrome is wrong.
I also tested with FireFox which also seems to be wrong:
I can also reproduce these results in Node.js.
But yes, Edge is getting it right:
Note that browsers also differ in which direction they set the local time, which falls within the "gap" created by the spring-forward transition. It is expected to be used for a future version of the ECMAScript specification .
I am not working on the actual implementation in these browsers, but I understand that both Chrome, Node and FireFox rely on ICU for internal timezone usage. My guess is that there is an ICU bug found here. Update: This seems to be a bug in the Microsoft C / C ++ Runtime. I am working to get the correct answers.
As for this - if accurate historical timezone data is important to your application, I highly recommend that you do not rely on the environment to provide it, but bring it yourself using one of the libraries I listed here , like moment-time (which I maintain ).
source to share