diff options
Diffstat (limited to 'django/utils/dateparse.py')
| -rw-r--r-- | django/utils/dateparse.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/django/utils/dateparse.py b/django/utils/dateparse.py index f2c079023f..cb45a2760b 100644 --- a/django/utils/dateparse.py +++ b/django/utils/dateparse.py @@ -24,7 +24,7 @@ datetime_re = 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<tzinfo>Z|[+-]\d{2}:?\d{2})?$' + r'(?P<tzinfo>Z|[+-]\d{2}(?::?\d{2})?)?$' ) @@ -76,7 +76,8 @@ def parse_datetime(value): if tzinfo == 'Z': tzinfo = utc elif tzinfo is not None: - offset = 60 * int(tzinfo[1:3]) + int(tzinfo[-2:]) + offset_mins = int(tzinfo[-2:]) if len(tzinfo) > 3 else 0 + offset = 60 * int(tzinfo[1:3]) + offset_mins if tzinfo[0] == '-': offset = -offset tzinfo = get_fixed_timezone(offset) |
