Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
>>> import datetime
>>> datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
>>> a='2014-11-19 15:53:42'
>>> b='2015-11-19 15:53:42'
How to calculate number of hours between these two dates (a,b),which method i can follow
Hello, have you tried using the .total_seconds() function?
delta = (b-a).total_seconds()
This function returns the seconds between two dates. After that, you need to convert it to hours.
Take a look at this.. http://stackoverflow.com/questions/4362491/how-do-i-check-the-difference-in-seconds-between-two-dates
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
|Asked: 11/19/14, 5:30 AM|
|Seen: 952 times|
|Last updated: 3/16/15, 8:10 AM|