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

Issue with dateparser #500

Open
lesleyxyz opened this issue Apr 4, 2023 · 0 comments
Open

Issue with dateparser #500

lesleyxyz opened this issue Apr 4, 2023 · 0 comments

Comments

@lesleyxyz
Copy link

lesleyxyz commented Apr 4, 2023

Code

    @freeze_time("2012-01-01")
    def testTime(self):
        from datetime import datetime
        import dateparser

        print(datetime.now())
        print(dateparser.parse("2 hours ago"))

Output

2012-01-01 00:00:00
2011-12-31 23:00:00

Expected output

2012-01-01 00:00:00
2011-12-31 22:00:00

When not using freezegun, the two dates are correclty 2 hours apart.

Environment

freezegun==1.2.2
Ubuntu 22.04.2 LTS
Python 3.10.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant