跳至內容
選單
此問題已被標幟
1 回覆
5728 瀏覽次數

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?

頭像
捨棄
最佳答案

See how to do it here

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

頭像
捨棄
作者

hmm not really , I have edit my question

相關帖文 回覆 瀏覽次數 活動
3
3月 24
4381
0
4月 18
5593
2
1月 24
2598
8
5月 23
61333
4
2月 23
71702