datetime.time() class - How to pass it a time string?
horpner at yahoo.com
Tue Jul 24 20:33:04 CEST 2007
On 2007-07-24, Robert Dailey <rcdailey at gmail.com> wrote:
> I have a string in the following format:
> I would like to pass this string into the datetime.time() class
> and have it parse the string and use the values. However, the
> __init__() method only takes integers (which means I'd be
> forced to parse the string myself). Does anyone know of a way I
> can make it use the string? Thanks.
Consult the documentation about time.strptime (to start) and then
datetime.strptime (which refers back to the time.strptime docs,
in a rather unfortunate manner).
More information about the Python-list