Elementary string-parsing

Paul Hankin paul.hankin at gmail.com
Mon Feb 4 04:57:25 EST 2008


On Feb 4, 3:21 am, Odysseus <odysseus1479... at yahoo-dot.ca> wrote:
> The next one is much messier. A couple of the strings represent times,
> which I think will be most useful in 'native' form, but the input is in
> the format "DD Mth YYYY HH:MM:SS UTC".

time.strptime will do this!

You can find the documentation at http://docs.python.org/lib/module-time.html

Untested:
time.strptime(my_date, '%d %b %y %H:%M:%S %Z')

--
Paul Hankin



More information about the Python-list mailing list