Skip to content

Conversation

@nullr0ute
Copy link

With dropping py < 3.9 support we can now move from pytz to zoneinfo which is part of stdlib from 3.9

With dropping py < 3.9 support we can now move from
pytz to zoneinfo which is part of stdlib from 3.9
tz = pytz.utc
expires = tz.localize(datetime.utcnow() + self.expiration)
tz = ZoneInfo("UTC")
expires = datetime.utcnow() + self.expiration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which is deprecated in recent versions as well. datetime.UTC is only there since 3.11, so maybe this is the best way out.

https://blog.miguelgrinberg.com/post/it-s-time-for-a-change-datetime-utcnow-is-now-deprecated

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quite happy for this to be closed and replaced which ever option you think is the best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants