Skip to content

[v2] Fix parse_timestamp for mid-year timezone changes - #10895

Open
simethan wants to merge 2 commits into
aws:v2from
simethan:fix/parse-timestamp-stale-offset-10852
Open

simethan wants to merge 2 commits into
aws:v2from
simethan:fix/parse-timestamp-stale-offset-10852

Conversation

@simethan

@simethan simethan commented Nov 13, 2026 •

Copy link
Copy Markdown

Issue #, if available: #10852

Description of changes:

parse_timestamp rendered epoch timestamps with dateutil's tzlocal(), which derives its standard/DST offsets from Jan 1 / Jul 1 of the current year. For zones whose rules changed mid-year (America/Vancouver in 2026, tzdata 2026b: standard offset moved from -08:00 to -07:00), it kept reporting the stale -08:00 offset. Epoch values now go through the stdlib (fromtimestamp(..., utc).astimezone()), which applies the per-instant offset from libc; other tzinfo options (e.g. tzwinlocal) are unchanged.

Description of tests:

Added test_parse_epoch_uses_system_offset_when_tzlocal_is_stale (fails before, passes after); tests/unit/botocore/test_utils.py: 317 passed, 11 failed — the 11 failures are pre-existing TestSSOTokenFetcher failures, identical on pristine code. ruff check clean.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Generated by AI tools, and reviewed by Ethan Sim.

@simethan
simethan marked this pull request as ready for review November 13, 2026 16:08
@simethan
simethan requested a review from a team as a code owner November 13, 2026 16:08
@simethan simethan changed the title Fix parse_timestamp for mid-year timezone changes [v2] Fix parse_timestamp for mid-year timezone changes Nov 13, 2026

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant