-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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 timezone handling for DateTimeField #5408
Conversation
- tests "current" timezone activation - tests output for non-UTC timezones
@@ -1165,7 +1170,7 @@ class TestDateTimeField(FieldValues): | |||
datetime.date(2001, 1, 1): ['Expected a datetime but got a date.'], | |||
} | |||
outputs = { | |||
datetime.datetime(2001, 1, 1, 13, 00): '2001-01-01T13:00:00', | |||
datetime.datetime(2001, 1, 1, 13, 00): '2001-01-01T13:00:00Z', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note - changed the datetime output from unaware to aware/UTC datetime, since the field itself is datetime-aware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. @rpkilby happy for you to merge when you’re ready. (Not sure if you want to wait for confirmation.)
Nice!
Yeah, I'll give it a few days for confirmation. |
Seems good. Will we want to mention any behavioral changes here in the release notes? |
|
@rpkilby - Okay, we'll want to think this over slightly when we come to writing the release notes. Needs to be a little clearer I think. |
(Otherwise great tho!) |
This should fix #3732, as well as the current/active timezone handling mentioned by @RichardForshaw.