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
import freezegun
from datetime import datetime
with freezegun.freeze_time("1970-01-01 00:00"):
print(datetime(2010, 10, 10).timestamp());
print(datetime(2010, 10, 10).strftime('%s'))
it prints different values for each of the methods:
1286668800.0
1286661600
Results are the same for the native datetime object
In [7]: datetime(2010, 10, 10).timestamp()
Out[7]: 1286661600.0
Seems something is wrong with the way timestamp() works on FakeDatetime
The bug was introduced in release 0.3.15
The text was updated successfully, but these errors were encountered:
Pacu2
changed the title
Inconsistency betewen timestamp() and strftime('%s')
v0.3.15 | Inconsistency betewen timestamp() and strftime('%s')
Mar 27, 2020
Pacu2
changed the title
v0.3.15 | Inconsistency betewen timestamp() and strftime('%s')
v0.3.15 | Inconsistency between timestamp and strftime
Mar 27, 2020
Consider the example below:
it prints different values for each of the methods:
Results are the same for the native datetime object
Seems something is wrong with the way
timestamp()
works onFakeDatetime
The bug was introduced in release 0.3.15
The text was updated successfully, but these errors were encountered: