Skip to content

Comments

fix: improper use of ucal_inDaylightTime#6097

Open
daksh-goyal wants to merge 4 commits intomicrosoft:mainfrom
daksh-goyal:tzdb-dst-fix
Open

fix: improper use of ucal_inDaylightTime#6097
daksh-goyal wants to merge 4 commits intomicrosoft:mainfrom
daksh-goyal:tzdb-dst-fix

Conversation

@daksh-goyal
Copy link

@daksh-goyal daksh-goyal commented Feb 21, 2026

ucal_inDaylightTime is used to check whether the timezone is currently observing DST. STL (likely in an attempt to be defensive) tries to use it as a way to tell whether the timezone observed DST on the date in question (which could be in the past), which is wrong.

Fixing that by omitting use of that guard before obtaining DST offset.

fixes: #6096

`ucal_inDaylightTime` is used to check whether the timezone is currently observing DST. STL (likely in an attempt to be defensive) tries to use it as a way to tell whether the timezone observed DST on the date in question (which could be in the past), which is wrong.
@daksh-goyal daksh-goyal requested a review from a team as a code owner February 21, 2026 23:58
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Feb 21, 2026
@StephanTLavavej StephanTLavavej added bug Something isn't working chrono C++20 chrono labels Feb 22, 2026
@github-project-automation github-project-automation bot moved this from Initial Review to Work In Progress in STL Code Reviews Feb 22, 2026
@daksh-goyal
Copy link
Author

@microsoft-github-policy-service agree company="Microsoft"

Added regression tests for timezones that abolished DST to ensure correct historical offsets.
@StephanTLavavej
Copy link
Member

Thanks! I've manually verified that the regression test produced all wrong answers before the fix.

@StephanTLavavej StephanTLavavej moved this from Work In Progress to Ready To Merge in STL Code Reviews Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working chrono C++20 chrono

Projects

Status: Ready To Merge

Development

Successfully merging this pull request may close these issues.

<chrono>: Incorrect time conversion for zones where DST was observed in the past

2 participants