Possible Duplicate:
How to construct a timedelta object from a simple string
I have a string that is in the format hours:minutes:seconds
but it is not a time of day but a duration. For example, 100:00:00
means 100 hours
.
I am trying to find the time that is offset from the current time by the amount of time specified in the string. I could use regular expressions to manually pull apart the time string and convert it to seconds and add it to the floating point returned by time.time()
, but is there a time
function to do this?
The time.strptime()
function formatting seems to work on time of day/date strings and not arbitrary strings.