mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Fixed #30803 -- Allowed comma separators for milliseconds in django.utils.dateparse functions.
Co-Authored-By: Ben Wilber <benwilber@gmail.com>
This commit is contained in:
parent
42b23d1e79
commit
1f817daa20
4 changed files with 25 additions and 7 deletions
|
@ -139,6 +139,10 @@ The functions defined in this module share the following properties:
|
|||
UTC offsets aren't supported; if ``value`` describes one, the result is
|
||||
``None``.
|
||||
|
||||
.. versionchanged:: 3.1
|
||||
|
||||
Support for comma separators for milliseconds was added.
|
||||
|
||||
.. function:: parse_datetime(value)
|
||||
|
||||
Parses a string and returns a :class:`datetime.datetime`.
|
||||
|
@ -146,18 +150,23 @@ The functions defined in this module share the following properties:
|
|||
UTC offsets are supported; if ``value`` describes one, the result's
|
||||
``tzinfo`` attribute is a :class:`datetime.timezone` instance.
|
||||
|
||||
.. versionchanged:: 3.1
|
||||
|
||||
Support for comma separators for milliseconds was added.
|
||||
|
||||
.. function:: parse_duration(value)
|
||||
|
||||
Parses a string and returns a :class:`datetime.timedelta`.
|
||||
|
||||
Expects data in the format ``"DD HH:MM:SS.uuuuuu"`` or as specified by ISO
|
||||
8601 (e.g. ``P4DT1H15M20S`` which is equivalent to ``4 1:15:20``) or
|
||||
PostgreSQL's day-time interval format (e.g. ``3 days 04:05:06``).
|
||||
Expects data in the format ``"DD HH:MM:SS.uuuuuu"``,
|
||||
``"DD HH:MM:SS,uuuuuu"``, or as specified by ISO 8601 (e.g.
|
||||
``P4DT1H15M20S`` which is equivalent to ``4 1:15:20``) or PostgreSQL's
|
||||
day-time interval format (e.g. ``3 days 04:05:06``).
|
||||
|
||||
.. versionchanged:: 3.1
|
||||
|
||||
Support for comma separators for decimal fractions in the ISO 8601
|
||||
format was added.
|
||||
format and for the format ``"DD HH:MM:SS,uuuuuu"`` was added.
|
||||
|
||||
``django.utils.decorators``
|
||||
===========================
|
||||
|
|
|
@ -259,6 +259,11 @@ Utilities
|
|||
* :func:`~django.utils.dateparse.parse_duration` now supports comma separators
|
||||
for decimal fractions in the ISO 8601 format.
|
||||
|
||||
* :func:`~django.utils.dateparse.parse_datetime`,
|
||||
:func:`~django.utils.dateparse.parse_duration`, and
|
||||
:func:`~django.utils.dateparse.parse_time` now support comma separators for
|
||||
milliseconds.
|
||||
|
||||
Validators
|
||||
~~~~~~~~~~
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue