[issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None)

2021-08-04 Thread Miksus
New submission from Miksus : I am trying to measure time twice and the second measurement gives a time that is 1 microsecond before the first measurement about half of the time. My experiment in short: --- import time, datetime start = time.time

[issue44831] Inconsistency between datetime.now() and datetime.fromtimestamp(time.time(), None)

2021-08-04 Thread Miksus
Miksus added the comment: I accidentially posted Python 3.6 link to the declaration of datetime.datetime.now() but this has been unchanged: https://github.com/python/cpython/blob/3d2b4c6f18d7e644e5850d2af74ac5dc530eb24c/Lib/datetime.py#L1696 The actual piece of code as of now: ... import