convert date time

Ronn Ross ronn.ross at gmail.com
Fri Aug 21 20:14:32 CEST 2009


I'm new to python and I'm getting a date time from a field in the database
that looks like this:
8/2/2009 8:36:16 AM (UTC)

I want to split it into two fields one with the date formatted like this:
YYYY-MM-DD  2009-08-02

and the time to be 24 hour or military time. How every you call it. Similar
to this:
15:22:00

I found it easy to truncate off the (UTC), but having trouble converting the
date. Can someone point me in the right direction?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090821/5feb96bc/attachment.html>


More information about the Python-list mailing list