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 datetime returning UTC #1262
Conversation
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>
Doesn't seem to be the same either. >>> datetime.datetime.utcfromtimestamp(0) + datetime.timedelta(seconds=1593721093)
datetime.datetime(2020, 7, 2, 20, 18, 13) >>> datetime.datetime.fromtimestamp(1593721093)
datetime.datetime(2020, 7, 2, 22, 18, 13) >>> datetime.datetime.fromtimestamp(0) + datetime.timedelta(seconds=1593721093)
datetime.datetime(2020, 7, 2, 21, 18, 13) |
I think that should work now. |
I've got a user getting an issue that i think may be related to this PR. The plex instance seems to have some weird addedAt dates and causing
|
Description
datetime.utcfromtimestamp
will emit a DeprecationWarning in Python 3.12.The "official" replacement would be to use
fromtimestamp(tz=timezone.utc).replace(tzinfo=None)
. However in this particular casedatetime(1970, 1, 1)
seems to be the easier solution.https://docs.python.org/3.12/library/datetime.html#datetime.datetime.utcfromtimestamp