Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5554 Visualizzazioni

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
Abbandona
Risposta migliore

See how to do it here

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

Avatar
Abbandona
Autore

hmm not really , I have edit my question

Post correlati Risposte Visualizzazioni Attività
3
mar 24
4215
0
apr 18
5452
2
gen 24
2374
8
mag 23
61022
4
feb 23
71384