[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.
New submission from Han Shaowen : What I am talking is like: Python 3.6.0 (default, Feb 28 2018, 15:41:04) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> from datetime import datetime >>> time.time() 1523942154.3787892 >>> datetime.now().timestamp() 1523942165.202865 >>> datetime.utcnow().timestamp() 1523913372.362377 Apparently, datetime.now().timestamp() give me right unix timestamp while utcnow().timestamp() doesn't. Fellas what do you think about this? -- components: Extension Modules messages: 315377 nosy: Han Shaowen priority: normal severity: normal status: open title: Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp. type: behavior versions: Python 3.6 ___ Python tracker <https://bugs.python.org/issue33293> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.
Han Shaowen added the comment: Guys, what I said is the doc in help(datetime.timestamp) is 'Return POSIX timestamp as float.' So I assumed it is irrelevant to time zone, considering POSIX timestamp's definition. If it is then datetime.now and datetime.utcnow should return the same timestamp. But datetime.now().timestamp return a correct timestamp which I checked in the website https://www.unixtimestamp.com/ but datetime.utcnow().timestamp did not. :) -- ___ Python tracker <https://bugs.python.org/issue33293> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33293] Using datetime.datetime.utcnow().timestamp() in Python3.6.0 can't get correct UTC timestamp.
Han Shaowen added the comment: Hohoho, I found the full-version doc. This issue over. Thanks Tim, Ned and Brett. And sorry about something improper I said, I respect female Pythonista. -- ___ Python tracker <https://bugs.python.org/issue33293> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com