This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author p-ganssle
Recipients belopolsky, gpetty, p-ganssle
Date 2020-06-26.00:49:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593132573.7.0.497625044736.issue41118@roundup.psfhosted.org>
In-reply-to
Content
There's a pretty clear warning on the documentation that utcfromtimestamp is unsuitable for this purpose: https://docs.python.org/3/library/datetime.html#datetime.datetime.utcfromtimestamp

What you want is a datetime that knows what time zone it's in, so that it can be translated back into the absolute number of seconds since UTC. The correct way to do that is to tell the datetime it's in UTC by attaching the `datetime.timezone.utc` object (or any equivalent `tzinfo`).

I have written a blog post explaining in detail why you should not use `utcnow` or `utcfromtimestamp`: https://blog.ganssle.io/articles/2019/11/utcnow.html

Hopefully that is helpful to you.
History
Date User Action Args
2020-06-26 00:49:33p-gansslesetrecipients: + p-ganssle, belopolsky, gpetty
2020-06-26 00:49:33p-gansslesetmessageid: <1593132573.7.0.497625044736.issue41118@roundup.psfhosted.org>
2020-06-26 00:49:33p-gansslelinkissue41118 messages
2020-06-26 00:49:33p-gansslecreate