Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.3.15 | Inconsistency between timestamp and strftime #343

Open
Pacu2 opened this issue Mar 27, 2020 · 0 comments · May be fixed by #356
Open

v0.3.15 | Inconsistency between timestamp and strftime #343

Pacu2 opened this issue Mar 27, 2020 · 0 comments · May be fixed by #356
Labels

Comments

@Pacu2
Copy link

Pacu2 commented Mar 27, 2020

Consider the example below:

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

@Pacu2 Pacu2 changed the title Inconsistency betewen timestamp() and strftime('%s') v0.3.15 | Inconsistency betewen timestamp() and strftime('%s') Mar 27, 2020
@Pacu2 Pacu2 changed the title v0.3.15 | Inconsistency betewen timestamp() and strftime('%s') v0.3.15 | Inconsistency between timestamp and strftime Mar 27, 2020
@spulec spulec added the bug label Apr 26, 2020
@mkarys mkarys linked a pull request Jun 27, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants