Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP] Fix DateTime.timeZoneName on Windows #55240

Closed
mraleph opened this issue Mar 19, 2024 · 2 comments
Closed

[CP] Fix DateTime.timeZoneName on Windows #55240

mraleph opened this issue Mar 19, 2024 · 2 comments
Assignees
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). cherry-pick-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. cherry-pick-review Issue that need cherry pick triage to approve merge-to-beta merge-to-stable

Comments

@mraleph
Copy link
Member

mraleph commented Mar 19, 2024

Commit(s) to merge

b0236fd

Target

beta and stable

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/358420
https://dart-review.googlesource.com/c/sdk/+/358440

Issue Description

DateTime.timeZoneName returns incorrect value on Windows when the machine is in the summer time but the given moment is in the standard time and vice versa.

What is the fix

Fix the implementation of the function to use the given moment rather then to look at the current time zone.

Why cherry-pick

There is a test failing on stable and beta branches - which makes other cherry picks harder.

Risk

low

Issue link(s)

#55159

Extra Info

/cc @a-siva

@mraleph mraleph added the cherry-pick-review Issue that need cherry pick triage to approve label Mar 19, 2024
@mit-mit
Copy link
Member

mit-mit commented Mar 19, 2024

LGTM

@a-siva
Copy link
Contributor

a-siva commented Mar 19, 2024

LGTM

copybara-service bot pushed a commit that referenced this issue Mar 19, 2024
It needs to look at the given moment to decide whether to use
summer time zone name or standard time zone name.

Previously it was looking at the current time to make this decision
which produced incorrect result: e.g. given
`DateTime.parse(2012-01-02T13:45:23)` its `timeZoneName` should be
returning standard name corresponding to the current time zone even
if we are currently running in summer time (e.g. it should
return PST if machine it is running on is in PDT).

This is revealed by a test which started to fail on Windows
because our Windows bots entered PDT.

Fixes #55159

TEST=corelib/date_time7_test.dart

CoreLibraryReviewExempt: No core library changes.
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/356681
Cherry-pick-request: #55240
Change-Id: Id4b593edfb4f0df967ff04d72efa86f320cc4e8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358420
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
copybara-service bot pushed a commit that referenced this issue Mar 19, 2024
It needs to look at the given moment to decide whether to use
summer time zone name or standard time zone name.

Previously it was looking at the current time to make this decision
which produced incorrect result: e.g. given
`DateTime.parse(2012-01-02T13:45:23)` its `timeZoneName` should be
returning standard name corresponding to the current time zone even
if we are currently running in summer time (e.g. it should
return PST if machine it is running on is in PDT).

This is revealed by a test which started to fail on Windows
because our Windows bots entered PDT.

Fixes #55159

TEST=corelib/date_time7_test.dart

CoreLibraryReviewExempt: No core library changes.
Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/356681
Cherry-pick-request: #55240
Change-Id: I11fb963ec90055db168c7f34bdf7c58229085bd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/358440
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Kevin Chisholm <kevinjchisholm@google.com>
@itsjustkevin itsjustkevin added the cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. label Mar 20, 2024
@mit-mit mit-mit added the area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-meta Cross-cutting, high-level issues (for tracking many other implementation issues, ...). cherry-pick-approved Label for approved cherrypick request cherry-pick-merged Cherry-pick has been merged to the stable or beta branch. cherry-pick-review Issue that need cherry pick triage to approve merge-to-beta merge-to-stable
Projects
None yet
Development

No branches or pull requests

7 participants