django.forms.DateTimeField does not properly handle aware datetimes as inputs
|Reported by:||Ion Scerbatiuc||Owned by:||Aymeric Augustin|
|Severity:||Normal||Keywords:||forms, DateTimeField, timezones|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If you have aware datetimes as inputs to a Form or ModelForm the cleaned values are localized to the local timezone discarding the timezone information that is part of the input data.
For a better understanding of the use case I have created a small test case (attached) to regress the issue.
Change History (5)
comment:1 Changed 4 years ago by
|Owner:||changed from nobody to Aymeric Augustin|
|Triage Stage:||Unreviewed → Design decision needed|
|Type:||Uncategorized → Bug|