تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
5736 أدوات العرض

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
مارس 24
4388
0
أبريل 18
5600
2
يناير 24
2605
8
مايو 23
61360
DateTime Python تم الحل
4
فبراير 23
71724