When trying to make things work with the datetime module, most Python users have faced a point when we resort to guess-and-check until the errors go away. datetime is one of those APIs that seems easy ...
Always use timezone-aware datetimes — datetime.now(timezone.utc), never datetime.utcnow() (deprecated in Python 3.12). Use zoneinfo.ZoneInfo for named time zones; reserve fixed UTC offsets for ...