#33066: DateTimeField does not exclusively validate the date time format against
DATETIME_INPUT_FORMATS
-------------------------------------+-------------------------------------
Reporter: Christian Reksten- | Owner: nobody
Monsen |
Type: Bug | Status: new
Component: Forms | Version: 3.2
Severity: Normal | Resolution:
Keywords: datetime iso8601 | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Christian Reksten-Monsen):
Reading the
[https://docs.djangoproject.com/en/3.2/ref/forms/fields/#datetimefield
docs on form DateTimeField], its seems that the intended functionality is
for the field to always accept ISO formats.
The field always accepts strings in ISO 8601 formatted dates or
similar recognized by parse_datetime().
I therefore suggest to add clarification on this to the
[https://docs.djangoproject.com/en/3.2/ref/settings/#datetime-input-
formats DATETIME_INPUT_FORMAT docs]. Maybe just simply adding below text
to the **Changed in Django 3.1** callout:
Support for ISO 8601 date string parsing (including optional
timezone) was added to DateTimeField form fields. The field always accepts
strings in ISO 8601 formatted dates or similar recognized by
parse_datetime(). The field will fallback on DATETIME_INPUT_FORMATS.
I have modified this ticket to reflect this being a documentation cleanup.
--
Ticket URL: <https://code.djangoproject.com/ticket/33066#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.4c5cfe69eda7b82bde488dd7624e026d%40djangoproject.com.