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

Fix now(tz) #1

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Fix now(tz) #1

merged 1 commit into from
Dec 18, 2023

Conversation

priezz
Copy link
Owner

@priezz priezz commented Dec 18, 2023

now(tz) should return the same time utcnow returns adjusted by whatever offset is contained by tz. Currently, the offset to freeze_time is also added, which is removed by this change

The current unit test is wrong because the UTC time is 2:00:00, so GMT5 should be 7:00:00, not 3:00:00

Closes spulec#405

now(tz) should return the same time utcnow returns adjusted by whatever
offset is contained by tz. Currently, the offset to freeze_time is also
added, which is removed by this change

The current unit test is wrong because the UTC time is 2:00:00, so GMT5
should be 7:00:00, not 3:00:00

Closes spulec#405

Watermelon AI Summary

This pull request addresses a time calculation bug in the now(tz) function where it incorrectly included an additional offset. The fix ensures now(tz) aligns correctly with UTC time considering the specified timezone, and also updates a flawed unit test to reflect accurate time adjustment behavior.

GitHub PRs

freezegun is an open repo and Watermelon will serve it for free.
🍉🫶
Have you starred Watermelon?

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

Successfully merging this pull request may close these issues.

tz_offset doesn't work with dateutil.tz
2 participants