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 <[email protected]>
<http://bugs.python.org/issue22377>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com