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 olvinroght
Recipients docs@python, olvinroght
Date 2020-12-18.21:36:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608327415.79.0.704757539161.issue42679@roundup.psfhosted.org>
In-reply-to
Content
Answering question on StackOverflow I've found next example in docs of datetime.timestamp() ( https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp ) which returns UTC timestamp:

timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)

While it works I think there's more explicit way using timedelta.total_seconds() :

timestamp = (dt - datetime(1970, 1, 1)).total_seconds()

In same article few lines above there's example using total_seconds() so I think it will be good to use same method in both examples.
History
Date User Action Args
2020-12-18 21:36:55olvinroghtsetrecipients: + olvinroght, docs@python
2020-12-18 21:36:55olvinroghtsetmessageid: <1608327415.79.0.704757539161.issue42679@roundup.psfhosted.org>
2020-12-18 21:36:55olvinroghtlinkissue42679 messages
2020-12-18 21:36:55olvinroghtcreate