strptime() doesn't recognize BST as a valid timezone

Dan dan at cellectivity.com
Fri Sep 16 10:28:00 EDT 2005


> I get: "ValueError: time data did not match format: ..."

I'm running Linux in London, and I don't get that error.

Python 2.3.5 (#2, May 29 2005, 00:34:43)
[GCC 3.3.6 (Debian 1:3.3.6-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> date_str = "Wed Sep 14, 2005 5:07 PM BST"
>>> format = "%a %b %d, %Y %I:%M %p %Z"
>>> time.strptime(date_str, format)
(2005, 9, 14, 17, 7, 0, 2, 257, 1)

However, when I used another timezone (I tried EST and PST), I got the
same error you did.

I really don't know enough about how Python handles dates to tell you
anything more.

-- 
  Diplomacy is saying "nice doggy" until you find a rock.
             - submitted by Nancy Greer
               to the CleanStuff mailing list





More information about the Python-list mailing list