datetime.now(UTC), not utcnow()
datetime.utcnow() gives you the right UTC time in an object with no tzinfo on it, so nothing downstream knows what offset it is. Compare it against an aware datetime and you get a TypeError, call .timestamp() on it and Python reads it as local time and shifts it by your offset.
from datetime import datetime, UTC
created = datetime.now(UTC)It's been deprecated since 3.12. Make every datetime aware where you create it, not where you print it, and the comparisons stop lying.
python