I recently learned that there is datetime.UTC which is an alias of datetime.timezone.utc
It helps a bit with the verbosity:
from datetime import datetime, UTC
datetime.now(UTC)
I recently learned that there is datetime.UTC which is an alias of datetime.timezone.utc
It helps a bit with the verbosity:
from datetime import datetime, UTC
datetime.now(UTC)
That's from 3.11 onwards.