Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
5822 Näkymät

How Can I make this end_time = datetime.now()
in seconds only, 

I have a start_time = datetime.now() and a end_time datetime.now()

I want to find the difference in seconds. 

How can I do that in python.?


I have testet this: with start_time = datetime.now() and end_time = datetime.now()

start_time = 2016-06-30 07:15:26.273169

end_time = 2016-06-30 07:15:26.273153

Then I do a final_time = (end_time - start_time).total_seconds()

it give me this back:  float -1.6e-05

How can I convert this in hours and minutes?

Avatar
Hylkää
Paras vastaus

See how to do it here

http://stackoverflow.com/questions/4362491/how-do-i-check-the-difference-in-seconds-between-two-dates

Avatar
Hylkää
Tekijä

hmm not really , I have edit my question

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
3
maalisk. 24
4446
0
huhtik. 18
5683
2
tammik. 24
2670
8
toukok. 23
61496
4
helmik. 23
71837