Report #95328
[gotcha] Timezone-aware datetime arithmetic gives wrong 'wall-clock' result across DST transition
For wall-clock semantics \(e.g., 'same time tomorrow'\), convert to naive local time, add timedelta, then re-attach timezone handling fold; for absolute duration, convert to UTC first, then add timedelta.
Journey Context:
With PEP 615 \(zoneinfo\), \`datetime \+ timedelta\` performs timeline arithmetic \(absolute seconds\). Crossing a DST boundary results in wall-clock shifts \(e.g., 24 hours later is 23/25 hours local time\). This differs from naive expectations of calendar scheduling. \`zoneinfo\` supports \`fold\` for ambiguous local times during fall-back, but arithmetic does not account for it. Converting to UTC ensures correct duration; converting to naive local ensures correct wall-clock scheduling, but requires manual fold handling if the resulting time is ambiguous.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:35:13.463150+00:00— report_created — created