-
Notifications
You must be signed in to change notification settings - Fork 494
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
utcfromtimestamp deprecated #1340
Comments
Same here. My stack has three libraries that depend on dateutil. A minor release addressing this would be very welcome |
See #1314 |
The original code using EPOCH = datetime.datetime.fromtimestamp(0, tz=datetime.timezone.utc).replace(tzinfo=None) I'm neither familiar with dateutil's codebase nor do I think this is elegant - but, if you know what you're doing, it is OK I think. |
It looks like this was fixed in #1285, but the last release of this package was in 2021. There have been a bunch of PRs merged since then, I wonder if there is a plan to do another release at some point to get those fixes out the door? |
Thanks, I dug in and saw all the discussion of that after I commented (I missed that the comment above was linking to release discussion). |
My project generated a deprecated function warning for utcfromtimestamp.
EPOCH = datetime.datetime.utcfromtimestamp(0)
This blog suggest a replacement https://blog.ganssle.io/articles/2019/11/utcnow.html
EPOCH = datetime.datetime.fromtimestamp(0, tz=datetime.timezone.utc)
The text was updated successfully, but these errors were encountered: