﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18728	dateparse datetime regex should accept colon in TZ offset	thaxter	Aymeric Augustin	"A legitimate ISO8601 datetime such as 2012-08-07T15:17:59.000+0000 will be rejected as input to a DateTime field. The dateparse.datetime_re matches with the colon: 2012-08-07T15:17:59.000+00:00.

According to spec, both are acceptable. Simply adding a ? after the colon in the regex fixes it:


{{{
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{1,2}:?\d{1,2})?$'
)
}}}

Diff format:
{{{
21c21
<     r'(?P<tzinfo>Z|[+-]\d{1,2}:\d{1,2})?$'
---
>     r'(?P<tzinfo>Z|[+-]\d{1,2}:?\d{1,2})?$'
}}}
"	Bug	closed	Core (Other)	1.4	Normal	fixed	datetime dateparse iso8601		Accepted	1	0	0	0	0	0
