[New-bugs-announce] [issue6641] strptime doesn't support %z format ?

Esteban Feldman report at bugs.python.org
Tue Aug 4 16:04:37 CEST 2009

New submission from Esteban Feldman <esteban.feldman at gmail.com>:

When trying to use datetime.strptime %z directive got an unexpected error.

>>> from datetime import datetime
>>> fecha = u'Sun Aug 02 19:01:25 +0000 2009'
>>> datetime.strptime(fecha, '%a %b %d %H:%M:%S %z %Y')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/_strptime.py", line 317, in _strptime
    (bad_directive, format))
ValueError: 'z' is a bad directive in format '%a %b %d %H:%M:%S %z %Y'

components: None
messages: 91256
nosy: Eka
severity: normal
status: open
title: strptime doesn't support %z format ?
type: behavior
versions: Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list