- #1
dacruick
- 1,042
- 1
Hello. Right now I've got two floats that represent times. say 9.5 for 9:30 and 16.5 for 4:30.
Basically I want to compare these to the current time, which right now I am doing by saying
So I don't want to use floats to compare those times, i want to put them into 'time' format.
which is hours:minutes:seconds.milliseconds. How would I convert those two floats 9.5 and 16.5?
dacruick
Basically I want to compare these to the current time, which right now I am doing by saying
Code:
dt=datetime.now()
while 9.5 < float(dt.strftime('%H')) + float(dt.strftime('%M')/60) < 16.5:
run all this stuff down here
So I don't want to use floats to compare those times, i want to put them into 'time' format.
which is hours:minutes:seconds.milliseconds. How would I convert those two floats 9.5 and 16.5?
dacruick