import datetime
s = '09:35:23'
datetime.datetime.strptime(s, '%H:%M:%S')
datetime.datetime(1900, 1, 1, 9, 35, 23)
Can you figure out how to proceed from there?
In case she doesn't know:
import datetime as dt
start="09:35:23"
end="10:23:00"
start_dt = dt.datetime.strptime(start, '%H:%
import datetime
s = '09:35:23'
datetime.datetime.strptime(s, '%H:%M:%S')
datetime.datetime(1900, 1, 1, 9, 35, 23)
Can you figure out how to proceed from there?
In case she doesn't know:
import datetime as dt
start="09:35:23"
end="10:23:00"
start_dt = dt.datetime.strptime(start, '%H:%M:
Use time.strptime() to parse them into seconds since the start of epoch, and
then an ordinary numeric subtraction will work.
Cheers
On Monday 02 March 2009 19:45, Judith Flores wrote:
> Hello,
>
>I can't seem to figure out the syntax to calculate the difference in
> minutes between two time
2009/3/3 Judith Flores :
>
> Hello,
>
> I can't seem to figure out the syntax to calculate the difference in
> minutes between two time stamps. I already read the documentation about
> datetime and time modules, but I was unable to implement the code.
>
> My code will be fed with two timestamps
Hello,
I can't seem to figure out the syntax to calculate the difference in minutes
between two time stamps. I already read the documentation about datetime and
time modules, but I was unable to implement the code.
My code will be fed with two timestamps (as styrings):
start="09:35:23"
end