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 tim.peters
Recipients Han Shaowen, ned.deily, tim.peters
Date 2018-04-17.20:58:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1523998736.21.0.682650639539.issue33293@psf.upfronthosting.co.za>
In-reply-to
Content
I agree this isn't a bug (and it was right to close it).  I expect the OP is confused about what the `.timestamp()` method does, though.  This note in the docs directly address what happens in their problematic `datetime.utcnow().timestamp()` case:

"""
Note There is no method to obtain the POSIX timestamp directly from a naive datetime instance representing UTC time. If your application uses this convention and your system timezone is not set to UTC, you can obtain the POSIX timestamp by supplying tzinfo=timezone.utc:

timestamp = dt.replace(tzinfo=timezone.utc).timestamp()

or by calculating the timestamp directly:

timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)
"""
History
Date User Action Args
2018-04-17 20:58:56tim.peterssetrecipients: + tim.peters, ned.deily, Han Shaowen
2018-04-17 20:58:56tim.peterssetmessageid: <1523998736.21.0.682650639539.issue33293@psf.upfronthosting.co.za>
2018-04-17 20:58:56tim.peterslinkissue33293 messages
2018-04-17 20:58:56tim.peterscreate