Odoo Help

0

How to make datetime.now() in seconds only?

By
wizardz
on 6/29/16, 10:12 AM 834 views

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?

1
Axel Mendoza
On 6/29/16, 4:43 PM

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

wizardz
on 6/30/16, 3:25 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 6/29/16, 10:12 AM
Seen: 834 times
Last updated: 7/4/16, 2:53 AM