Parsing date strings into tuples

Tim Roberts timr at probo.com
Mon Feb 25 02:15:48 EST 2002


Joonas Paalasmaa <joonas at olen.to> wrote:
>
>Question 2:
>Why doesn't this work?
>
> >>> time.strptime('Wed, 20 Feb 2002 09:25:29 EET',
>     "%a, %d %b %Y %H:%M:%S %Z")
>Traceback (most recent call last):
>   File "<pyshell#5>", line 1, in ?
>     time.strptime('Wed, 20 Feb 2002 09:25:29 EET', "%a, %d %b %Y 
>%H:%M:%S %Z")
>ValueError: unconverted data remains: 'EET'

Because your C library strptime call does not recognize EET as a time zone.
EET is also not acknowledged in RFC [2]822.  You get the American zones,
/[PMCE][SD]T/, and the recommended numeric zones, like -0700 and +0530, but
not any arbitrary zone.

Also note that time.strptime is not available on Windows systems at all.
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list