parse date string having "EDT"

Ben Finney ben+python at benfinney.id.au
Tue Jun 21 00:12:34 EDT 2011


Junaid P V <junu.pv at gmail.com> writes:

> I tried:
>
> datetime.strptime('Mon Jun 20 14:00:57 EDT 2011', '%a %b %d %H:%M:%S %Z %Y')
>
> But I get error

When reporting that you get an error, please give the full error and
traceback.


My mind reading skills are telling me, though, that you're getting a
ValueError because you're trying to parse a timezone that is unknown to
the ‘time.strptime’ function. See its documentation for why
<URL:http://docs.python.org/library/time.html#time.strptime>.

-- 
 \       “Give a man a fish, and you'll feed him for a day; give him a |
  `\    religion, and he'll starve to death while praying for a fish.” |
_o__)                                                       —Anonymous |
Ben Finney



More information about the Python-list mailing list