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

Replace deprecated datetime.utcfromtimestamp, datetime.utcnow #420

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

Conversation

andersk
Copy link

@andersk andersk commented Oct 22, 2024

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

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.

https://docs.python.org/3/whatsnew/3.12.html#deprecated
“`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`.”

Signed-off-by: Anders Kaseorg <[email protected]>
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.

1 participant