Odoo Help


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

on 6/29/16, 10:12 AM 968 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?


Axel Mendoza

--Axel Mendoza--
| 7 8 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full-time employee trying to understand what to do and how

Reach me at aekroft@gmail.com

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

See how to do it here


hmm not really , I have edit my question

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.


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)


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