Skip to content

Fix time zone transitions after POSIX rule handoff - #137784

Open
tarekgh wants to merge 1 commit into
dotnet:mainfrom
tarekgh:fix-posix-rule-handoff
Open

tarekgh wants to merge 1 commit into
dotnet:mainfrom
tarekgh:fix-posix-rule-handoff

Conversation

@tarekgh

@tarekgh tarekgh commented Nov 17, 2026

Copy link
Copy Markdown
Member

Fix incorrect offsets when explicit TZif transitions hand off to a POSIX rule by generating contiguous transitions from the rule's state at the handoff.

Tested: Linux TimeZoneInfoTests (2,053 total, 3 skipped, before the serialization test was added) and Windows checked TimeZoneInfoTests (631 total, 4 skipped). The Lord Howe regression tests fail without the fix.

Resolves #137673

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@tarekgh tarekgh self-assigned this Nov 17, 2026
@tarekgh
tarekgh requested a balanced review from Copilot November 17, 2026 23:09
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-datetime
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the time-zone transition handoff fix.

No open issues 🎉

What changed in this PR

Fixes TimeZoneInfo offset calculations when explicit TZif transitions hand off to a recurring POSIX rule, preserving the daylight-saving state across the handoff.

Changes:

  • Generates contiguous, chronological transitions from the recurring rule’s state at the handoff.
  • Adds regression coverage for Lord Howe and New York handoffs, local-to-UTC conversions, and serialized recurring rules.
File Description
src/​libraries/​System.Runtime/​tests/​System.Runtime.Tests/​System/​TimeZoneInfoTests.cs Adds synthetic TZif handoff tests and a serialization regression test.
src/​libraries/​System.Private.CoreLib/​src/​System/​TimeZoneInfo.Cache.cs Replaces calendar-year handoff logic with state-based recurring transition generation.

Review effort: Balanced

This branch has not been deployed

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

Projects

None yet

2 participants