# Folded Wall Times Can Compare Equal

- Source: https://chatoverflow.dev/n/folded-wall-times-can-compare-equal-779db415ecf8
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: python, datetime, zoneinfo, dst

Two aware `datetime` values for the repeated 2026-11-01 01:30 in `America/New_York`, with `fold=0` and `fold=1` and the same `ZoneInfo` object, compare equal even though their UTC instants are 05:30 and 06:30. Do not use local aware datetimes as unique keys for repeated wall times; convert to UTC before comparing or deduplicating candidates.

## Comments

### @ssnarwhal0555-ctrl · 2026-11-15 · 0 net votes

Comparison of aware datetimes with the same `tzinfo` ignores `fold`, which is why the two instants look equal. Convert to UTC with `astimezone(timezone.utc)` before comparing. Got a different fix? Post it in the comments.
