summaryrefslogtreecommitdiff
path: root/django/utils/dateparse.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils/dateparse.py')
-rw-r--r--django/utils/dateparse.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/django/utils/dateparse.py b/django/utils/dateparse.py
index 08651f57ad..5cedd1affa 100644
--- a/django/utils/dateparse.py
+++ b/django/utils/dateparse.py
@@ -14,13 +14,13 @@ date_re = _lazy_re_compile(r"(?P<year>\d{4})-(?P<month>\d{1,2})-(?P<day>\d{1,2})
time_re = _lazy_re_compile(
r"(?P<hour>\d{1,2}):(?P<minute>\d{1,2})"
- r"(?::(?P<second>\d{1,2})(?:[\.,](?P<microsecond>\d{1,6})\d{0,6})?)?$"
+ r"(?::(?P<second>\d{1,2})(?:[.,](?P<microsecond>\d{1,6})\d{0,6})?)?$"
)
datetime_re = _lazy_re_compile(
r"(?P<year>\d{4})-(?P<month>\d{1,2})-(?P<day>\d{1,2})"
r"[T ](?P<hour>\d{1,2}):(?P<minute>\d{1,2})"
- r"(?::(?P<second>\d{1,2})(?:[\.,](?P<microsecond>\d{1,6})\d{0,6})?)?"
+ r"(?::(?P<second>\d{1,2})(?:[.,](?P<microsecond>\d{1,6})\d{0,6})?)?"
r"\s*(?P<tzinfo>Z|[+-]\d{2}(?::?\d{2})?)?$"
)
@@ -31,7 +31,7 @@ standard_duration_re = _lazy_re_compile(
r"((?:(?P<hours>\d+):)(?=\d+:\d+))?"
r"(?:(?P<minutes>\d+):)?"
r"(?P<seconds>\d+)"
- r"(?:[\.,](?P<microseconds>\d{1,6})\d{0,6})?"
+ r"(?:[.,](?P<microseconds>\d{1,6})\d{0,6})?"
r"$"
)
@@ -40,11 +40,11 @@ standard_duration_re = _lazy_re_compile(
iso8601_duration_re = _lazy_re_compile(
r"^(?P<sign>[-+]?)"
r"P"
- r"(?:(?P<days>\d+([\.,]\d+)?)D)?"
+ r"(?:(?P<days>\d+([.,]\d+)?)D)?"
r"(?:T"
- r"(?:(?P<hours>\d+([\.,]\d+)?)H)?"
- r"(?:(?P<minutes>\d+([\.,]\d+)?)M)?"
- r"(?:(?P<seconds>\d+([\.,]\d+)?)S)?"
+ r"(?:(?P<hours>\d+([.,]\d+)?)H)?"
+ r"(?:(?P<minutes>\d+([.,]\d+)?)M)?"
+ r"(?:(?P<seconds>\d+([.,]\d+)?)S)?"
r")?"
r"$"
)