[issue6165] strftime incorrectly processes DST flag when passed time touples

Jonathan report at bugs.python.org
Mon Jun 1 19:38:21 CEST 2009


New submission from Jonathan <jonathan.cervidae at gmail.com>:

>>> import time
>>> time.strftime("%FT%T%z")
'2009-06-01T18:35:42+0100'
>>> # Expect to see +0100
>>> time.strftime("%FT%T%z",time.localtime())
'2009-06-01T18:35:42+0000'
>>> time.strftime("%FT%T%Z",time.localtime())
'2009-06-01T18:35:42BST'
>>> made_up_time = list(time.localtime())
>>> made_up_time
[2009, 6, 1, 18, 35, 48, 0, 152, 1]
>>> made_up_time[1] = 2
>>> made_up_time=tuple(made_up_time)
>>> time.strftime("%FT%T%z",made_up_time)
'2009-02-01T18:35:48+0000'
>>> # Expect to see GMT or UTC, whatever strftime wants to call it.
>>> time.strftime("%FT%T%Z",made_up_time)
'2009-02-01T18:35:48BST'
>>>

----------
components: Extension Modules
messages: 88659
nosy: jonathan.cervidae
severity: normal
status: open
title: strftime incorrectly processes DST flag when passed time touples
type: behavior
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6165>
_______________________________________


More information about the Python-bugs-list mailing list