Report #97809
[gotcha] datetime.replace\(tzinfo=...\) silently attaches a timezone instead of converting the wall time
Use dt.astimezone\(tz\) to convert an aware datetime, or dt.replace\(tzinfo=tz\) only when you are intentionally tagging a naive datetime with its true timezone without shifting the clock reading.
Journey Context:
replace\(\) mutates metadata, not the moment-in-time. A naive 10:00 with replace\(tzinfo=UTC\) becomes '10:00 UTC', not the UTC equivalent of your local 10:00. astimezone\(\) does the arithmetic and handles DST. The confusion comes because 'replace' sounds like conversion; in datetime it means override fields.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:44:08.953503+00:00— report_created — created