[New-bugs-announce] [issue22377] %Z in strptime doesn't match EST and others
Ram Rachum
report at bugs.python.org
Wed Sep 10 00:24:15 CEST 2014
New submission from Ram Rachum:
The documentation for %Z ( https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior ) says it matches `EST` among others, but in practice it doesn't:
Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
DreamPie 1.2.1
>>> import datetime
>>> datetime.datetime.strptime('2016-12-04 08:00:00 UTC', '%Y-%m-%d %H:%M:%S %Z')
0: datetime.datetime(2016, 12, 4, 8, 0)
>>> datetime.datetime.strptime('2016-12-04 08:00:00 EST', '%Y-%m-%d %H:%M:%S %Z')
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
datetime.datetime.strptime('2016-12-04 08:00:00 EST', '%Y-%m-%d %H:%M:%S %Z')
File "C:\Python34\lib\_strptime.py", line 500, in _strptime_datetime
tt, fraction = _strptime(data_string, format)
File "C:\Python34\lib\_strptime.py", line 337, in _strptime
(data_string, format))
ValueError: time data '2016-12-04 08:00:00 EST' does not match format '%Y-%m-%d %H:%M:%S %Z'
>>>
----------
components: Library (Lib)
messages: 226668
nosy: cool-RR
priority: normal
severity: normal
status: open
title: %Z in strptime doesn't match EST and others
type: behavior
versions: Python 3.4
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22377>
_______________________________________
More information about the New-bugs-announce
mailing list