[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date

2014-11-10 Thread Doug Gorley

New submission from Doug Gorley:

strptime() is returning the wrong date if I try to parse today's date 
(2014-11-10) as a string with no separators, and if I ask strpdate() to look 
for nonexistent hour and minute fields.

>>> datetime.datetime.strptime('20141110', '%Y%m%d').isoformat()
'2014-11-10T00:00:00'
>>> datetime.datetime.strptime('20141110', '%Y%m%d%H%M').isoformat()
'2014-01-01T01:00:00'

--
components: Library (Lib)
messages: 230977
nosy: dgorley
priority: normal
severity: normal
status: open
title: strpdate('20141110', '%Y%m%d%H%S') returns wrong date
type: behavior
versions: Python 3.4

___
Python tracker 
<http://bugs.python.org/issue22840>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22840] strpdate('20141110', '%Y%m%d%H%S') returns wrong date

2014-11-10 Thread Doug Gorley

Doug Gorley added the comment:

I expected the second call to strpdate() to throw an exception, because %Y 
consumed '2014', %m consumed '11', and %d consumed '10', leaving nothing for %H 
and %M to match.  That would be consistent with the first call.

--

___
Python tracker 
<http://bugs.python.org/issue22840>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com