The docs also say that %z is new in version 2.6... so are you running
On Nov 26, 8:33 pm, "Luke Graybill" <
killa...@gmail.com> wrote:
> Hello all, I'm having some issues here with datetime.strptime not performing
> as documented, and before I resign myself to manually parsing this string, I
> thought I'd check with some brighter minds.
>
> I'm using the following code to attempt to convert an ISO-8601 formatted
> string such as '2008-11-20T04:00:00-0700' to a datetime object:
>
> >>> value = '2008-11-20T04:00:00-0700'
> >>> datetime.strptime(value, '%Y-%m-%dT%H:%M:%S%z')
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/usr/lib/python2.5/_strptime.py", line 320, in strptime
> (bad_directive, format))
> ValueError: 'z' is a bad directive in format '%Y-%m-%dT%H:%M:%S%z'
>
> According to the