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 docs on timezone of naive date(time) strings #306

Merged
merged 2 commits into from
Sep 19, 2023

Conversation

soxofaan
Copy link
Contributor

@soxofaan soxofaan commented Dec 2, 2022

Addresses the documentation issue raised in #257:
passing a naive date string to travel will be interpreted as local time

@adamchainz
Copy link
Owner

That isn’t a documentation issue, the current behaviour is indeed to intepret as UTC...?

@soxofaan
Copy link
Contributor Author

soxofaan commented Dec 4, 2022

The current behavior of passing something like destination="2022-02-20" is to interpret as local time (see the added tests), the documentation states otherwise (interpret as UTC).
So there is at least a bug in one of:

  • the implementation
  • the documentation

This PR fixes the documentation (which is the easiest option)

@Siburg
Copy link

Siburg commented Jul 9, 2023

Just found same issue today, after replacing freezegun with time_machine. I was actually quite pleased to see that a string was interpreted as being for the timezone in my settings. Made my tests more readable in my opinion. But I was subsequently surprised that the documentation indicates something different. So I support updating the documentation, and leaving functionality as-is.

@adamchainz adamchainz changed the title Fix documentation about using local time for naive date(time) strings Fix docs on timezone of naive date(time) strings Sep 19, 2023
@adamchainz
Copy link
Owner

Thank you for the docs patch.

@adamchainz adamchainz enabled auto-merge (squash) September 19, 2023 10:17
@adamchainz adamchainz merged commit 3c70dd5 into adamchainz:main Sep 19, 2023
6 checks passed
adamchainz added a commit that referenced this pull request Sep 19, 2023
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.

3 participants