Windows Time Zone offset is wrong when Automatic DST setting is OFF

Description

Recently Chrome team start to roll out m88, which is the first version with icu68.1 and https://github.com/unicode-org/icu/pull/1465 but got a growing number of report of timezone problem on windows
See https://bugs.chromium.org/p/chromium/issues/detail?id=1168528

I suspect it is related to
https://github.com/unicode-org/icu/pull/1362
and
https://github.com/unicode-org/icu/pull/1465

What we know so far is the problem come from Japan and Russia
and the report came from the following version of windows

Windows NT: 6.1.7601 SP1
Windows NT: 10.0.18363
Windows NT: 10.0.18363
Windows NT: 10.0.19041
Windows NT: 10.0.19042
Windows NT: 10.0.19042
Windows NT: 10.0.19042

Activity

Show:
Brandon
March 24, 2021, 1:19 AM

Thanks Jeff. I used the Automatic DST setting you spoke of and followed your instruction in your reply to Frank. Worked like a champ with my current issue. It would be nice to have a better way to Test the Windows Time Zone detection code though. Either way, much appreciated.

Thank you! -Brandon T, Owner, https://treeservicegainesville.weebly.com/

Jeff Genovy
March 3, 2021, 7:46 PM
Jeff Genovy
February 10, 2021, 5:30 PM

The PR description had more info on why it was wrong, copy/pasting it here in case that helps to explain things:

It turns out that the offset value for the calculated time zone when the "Automatic DST" setting is turn off is wrong. The sign for the time zone offset is flipped. (It's positive when it should be negative, and vice-versa).

I think this was perhaps due to confusion about the value for the UTC offset, how POSIX style offsets are handled, and what is reported by the Win32 API GetDynamicTimeZoneInformation.
It seems that this issue was actually present in the original PR for ICU-13845 here: #1297 , and it was missed in the reviews on the other PR for the ticket here: #1362 

Jeff Genovy
January 26, 2021, 9:38 PM

Right, you don’t actually need to change the time zone if you are already in PST in order to hit the issue. If you disable the “Automatic DST” setting in the Control Panel then you will get the wrong offset with the icuinfo.exe program, and if you check the date/time in Chrome Console with new Date(); in the console then you will see the wrong time reported.

Here’s a screenshot on Win7 with Chrome Canary with PST time zone when the “Automatic DST” setting is off in the Control Panel.

FWIW, I used the time zone “(UTC+10:00) Canberra, Melbourne, Sydney” in the test 7 case in the document as that was one of the time zones that was reported in the bug here for the DST setting: https://bugs.chromium.org/p/chromium/issues/detail?id=927703

Fixed
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Jeff Genovy

Reporter

Frank Yung-Fong Tang

Components

Priority

major

Fix versions