Issue1689

classification
Title: datetime strftime %f doesn't seem to work.
Type: behaviour Severity: normal
Components: Core Versions: 2.5.1
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: monojohnny, pjenvey
Priority: Keywords:

Created on 2010-12-20.14:51:46 by monojohnny, last changed 2010-12-20.19:38:02 by pjenvey.

Messages
msg6288 (view) Author: John Pritchard-Williams (monojohnny) Date: 2010-12-20.14:51:46
The following code-snippet fails to see the microseconds portion of a datetime:

-- CUT HERE --
from datetime import datetime
dt=datetime.now()
dt.strftime("%Y-%m-%d %H:%M:%S")+","+dt.strftime("%f")
-- CUT HERE --
-- RESULT FROM JYTHON 2.5.1:
'2010-12-20 14:37:04,'%f'

This is the output from cpython (actually release 2.6 - so not testing like with like?):

-- RESULT FROM CPYTHON 2.6.2
'2010-12-20 14:37:33,884'
msg6289 (view) Author: Philip Jenvey (pjenvey) Date: 2010-12-20.19:38:01
{{{
Python 2.5.4 (r254:67916, Feb 11 2010, 00:50:55) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> dt=datetime.now() 
>>> dt.strftime('%f')
'f'
}}}


%f must have only been added in 2.6
History
Date User Action Args
2010-12-20 19:38:02pjenveysetstatus: open -> closed
resolution: invalid
messages: + msg6289
nosy: + pjenvey
2010-12-20 14:51:46monojohnnycreate