Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5533 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
มี.ค. 24
4195
0
เม.ย. 18
5427
2
ม.ค. 24
2329
[Solved] Date/ Time in Odoo with python แก้ไขแล้ว
8
พ.ค. 23
60974
DateTime Python แก้ไขแล้ว
4
ก.พ. 23
71329