Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1012 DeprecationWarning: datetime.datetime.utcnow() is deprecated #1014

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ruitcatarino
Copy link

Fixes #1012
Refactored the code to use datetime.now(timezone.utc) instead of the deprecated version datetime.utcnow.

https://docs.python.org/3/whatsnew/3.12.html

datetime: datetime.datetime’s utcnow() and utcfromtimestamp() are deprecated and will be removed in a future version. Instead, use timezone-aware objects to represent datetimes in UTC: respectively, call now() and fromtimestamp() with the tz parameter set to datetime.UTC. (Contributed by Paul Ganssle in gh-103857.)

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.

DeprecationWarning: datetime.datetime.utcnow() is deprecated
1 participant