You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@spulec While it might be the same cause, I don't think it's really the same issue.
Let's say you do freeze_time("2019-01-30T12:00:00+00:00"). I think it's entirely reasonable to then get FakeDatetime(2019, 1, 30, 12, 0) when calling both now() and utcnow(), which is what that issue is complaining about.
The problem here is that when my computer is in UTC+1, calling utcnow().timestamp() will get you the 1548846000.0, which is actually the timestamp for 2019-01-30T11:00:00+00:00:00, meaning that the timestamp generated is an hour off from what it should be.
Meanwhile datetime.utcfromtimestamp(datetime.utcnow().timestamp()) will actually give you FakeDatetime(2019, 1, 30, 11, 0) as it should.
This means that datetime.utcnow() is NOT equal to datetime.utcfromtimestamp(datetime.utcnow().timestamp()), which is rather broken behaviour.
Python 3
Code:
Output:
Expected:
The datetime object seems correct but the timestamp is not?
The text was updated successfully, but these errors were encountered: