Title: strptime, strftime documentation
Type: Stage: resolved
Components: Documentation Versions: Python 3.1, Python 3.2, Python 2.7, Python 2.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: brian.curtin, docs@python, ezio.melotti, georg.brandl, mikejs, r.david.murray
Priority: normal Keywords: patch

Created on 2010-01-14 01:46 by mikejs, last changed 2012-06-10 14:05 by r.david.murray. This issue is now closed.

File name Uploaded Description Edit
strptime.diff mikejs, 2010-01-14 01:45 review
strptime.diff mikejs, 2010-01-14 05:38 review
Messages (4)
msg97748 - (view) Author: Michael Stephens (mikejs) Date: 2010-01-14 01:45
The documentation for strftime and strptime behavior strikes me as a bit jumbled right now. The behavior of datetime.datetime.strptime is explained by a reference to time.strptime, which in turn references time.strftime to explain the format string.

The docs for the datetime.{datetime,date,time}.strftime methods, on the other hand, reference the 'strftime Behavior' section of the datetime module docs to explain the behavior of the format string. This section even notes the differences between strptime and strftime behavior.

I've tried to clear this up a little bit by renaming this section 'strftime and strptime Behavior' and referencing it from the datetime.datetime.strptime docs.
msg97751 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-01-14 04:04
Seems reasonable.

Additionally, the block about time.strftime not utilizing date related formats (line 1514 in the patched file) can be removed. It has worked for a long time (forever?).

>>> time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
'2010-01-13 21:32:52'
msg97753 - (view) Author: Michael Stephens (mikejs) Date: 2010-01-14 05:38
I think it's referring to:

>>> datetime.time(10, 34, 6).strftime("%Y-%m-%d %H:%M:%S")
'1900-01-01 10:34:06'

and thus still applies. It is wrong about month and day being replaced by '0', however, and I've updated the patch to change that to '1'.
msg162586 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-06-10 14:05
This was applied by Georg in SVN revision r77561 on 2010-01-17.
Date User Action Args
2012-06-10 14:05:57r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg162586

resolution: fixed
stage: patch review -> resolved
2010-07-22 15:37:56BreamoreBoysetassignee: georg.brandl -> docs@python

nosy: + docs@python
2010-01-14 05:38:14mikejssetfiles: + strptime.diff

messages: + msg97753
2010-01-14 04:04:01brian.curtinsetnosy: + brian.curtin
messages: + msg97751
2010-01-14 02:55:17ezio.melottisetpriority: normal
nosy: + ezio.melotti
versions: + Python 2.6, Python 3.1, Python 3.2

stage: patch review
2010-01-14 01:46:00mikejscreate