Skip to content

ICU-21465 Cherry-pick: Fix Windows Time Zone mapping when the Automatic DST setting is OFF to ICU 68. - #1543

Merged
jefgen merged 1 commit into
unicode-org:maint/maint-68from
jefgen:jefgen/cp-ICU-21465-to-ICU68
Jan 27, 2021
Merged

jefgen merged 1 commit into
unicode-org:maint/maint-68from
jefgen:jefgen/cp-ICU-21465-to-ICU68

Conversation

@jefgen

@jefgen jefgen commented Jan 26, 2021

Copy link
Copy Markdown
Member

This PR is cherry-picking the change from PR #1539 into the maint/maint-68 branch. (Cherry-picked from commit a1a1faf).

From the other PR description:

This PR fixes a bug in the changes for ICU-13845, for handling when the "Automatic DST" setting is OFF in the Control Panel.

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 .

I also missed this when I was manually testing out the changes, as I was expecting the wrong values for the offset to be reported. (For example, Etc/GMT-8 instead of Etc/GMT+8).

Note: The actual change here is only one character. The rest are comments that I added in order to help explain things for others in the future.

Testing:

I created a document that has different manual test cases that exercise various scenarios for most of the code paths for the Windows TZ mapping in ICU. (I also added notes on what the various test cases are exercising in the code.)
Link: https://docs.google.com/document/d/17Y_Ns4EBV8wnHioJNFc-dJCRRpJ3hpJZDYmTq6ekIsM
(The test case 7 in the document reproduces the issue that this PR fixes).

Checklist

…ic DST setting is OFF to ICU 68.

cherry-picked from commit a1a1faf
@jefgen jefgen added the cherry-pick This PR is a cherry-pick of an already-approved-and-merged PR to another branch. label Jan 26, 2021
@jefgen
jefgen merged commit c6934ff into unicode-org:maint/maint-68 Jan 27, 2021
@jefgen
jefgen deleted the jefgen/cp-ICU-21465-to-ICU68 branch January 27, 2021 19:00
jefgen added a commit to microsoft/icu that referenced this pull request Jan 28, 2021
This change cherry-picks the upstream fix for the issue of the Windows
Time Zone offset being wrong when Automatic DST setting is OFF in the Control Panel.

ICU-21465 Windows Time Zone offset is wrong when Automatic DST setting is OFF
https://unicode-org.atlassian.net/browse/ICU-21465

Cherry-picked from upstream commit: c6934ff7476200fc22abdf4300c94e2a3460c793

The upstream PR into master is here:
unicode-org/icu#1465

The upstream PR into maint/maint-68 is here:
unicode-org/icu#1543
jefgen added a commit to microsoft/icu that referenced this pull request Jan 29, 2021
…65)

This change cherry-picks the upstream fix for the issue of the Windows
Time Zone offset being wrong when Automatic DST setting is OFF in the Control Panel.

ICU-21465 Windows Time Zone offset is wrong when Automatic DST setting is OFF
https://unicode-org.atlassian.net/browse/ICU-21465

Cherry-picked from upstream commit: c6934ff7476200fc22abdf4300c94e2a3460c793

The upstream PR into master is here:
unicode-org/icu#1465

The upstream PR into maint/maint-68 is here:
unicode-org/icu#1543

Detailed Description:
This fixes a bug in the changes for ICU-13845, for handling when the "Automatic DST" setting is OFF in the Control Panel.

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 and it was missed in the reviews on the other PR for the ticket.

@ViniciusFXavier ViniciusFXavier left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick This PR is a cherry-pick of an already-approved-and-merged PR to another branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants