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

when USE_TZ=False, datetimes must be timezone naive #787

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

rafalstapinski
Copy link

Description

This changes the USE_TZ setting to control whether Tortoise is dealing with timezone aware or timezone naive datetimes.
When USE_TZ=False, all datetimes should be timezone naive.
When USE_TZ=True, all datetimes should be timezone aware, with the timezone being specified by the TIMEZONE setting.

Motivation and Context

Currently, USE_TZ is a misnomer. It suggests you can either use TZ aware datetimes, or you can use TZ naive datetimes. It's implementation does something different - all datetimes are aware, but in USE_TZ=False they are UTC.

This makes the USE_TZ setting useless, as USE_TZ=False == USE_TZ=True, TIMEZONE=UTC.
#631

How Has This Been Tested?

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@rafalstapinski
Copy link
Author

@long2ice I'm hoping to fix some of the inconsistencies in the USE_TZ setting. I've been working through postgres changes, but would like access to running the testing pipeline to speed up validation. Any chance you could approve me running tests against this?

@rafalstapinski
Copy link
Author

@long2ice bump on the above, any help would be appreciated

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.

1 participant