I'm trying to convert the following String to datetime object in Python.
datetime_object = datetime.strptime('Sat, 26 Nov 2016 15:17:00 +0000', '%a, %b %d %Y %H:%c %z')
I get the following error,
File "<stdin>", line 1, in <module>File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_strptime.py", line 577, in _strptime_datetimett, fraction, gmtoff_fraction = _strptime(data_string, format)File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_strptime.py", line 342, in _strptimeformat_regex = _TimeRE_cache.compile(format)File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_strptime.py", line 272, in compilereturn re_compile(self.pattern(format), IGNORECASE)File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 234, in compilereturn _compile(pattern, flags)File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 286, in _compilep = sre_compile.compile(pattern, flags)File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/sre_compile.py", line 764, in compilep = sre_parse.parse(p, flags)File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/sre_parse.py", line 930, in parsep = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/sre_parse.py", line 426, in _parse_subnot nested and not items))File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/sre_parse.py", line 813, in _parseraise source.error(err.msg, len(name) + 1) from None
re.error: redefinition of group name 'a' as group 6; was group 1 at position 185
What am I doing wrong here?