Odoo Help

0

0
2 Answers
0
Avatar

Atchuthan - Technical Consultant, Sodexis Inc India

--Atchuthan - Technical Consultant, Sodexis Inc--
4412
| 6 6 10
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc India
12/3/14, 2:34 AM

Try this

d_frm_obj = datetime.strptime(date_from, DEFAULT_SERVER_DATETIME_FORMAT)
d_to_obj = datetime.strptime(date_to, DEFAULT_SERVER_DATETIME_FORMAT)
temp_date = d_to_obj - d_frm_obj
print temp_date.seconds/3600       //This will provide hours.
print (diff.days *24) + (diff.seconds/3600)    //Provides total number of hours including days 

For more info: http://stackoverflow.com/a/2119512/2470366

1 Comment
Odoo India
12/3/14, 5:29 AM

Thanks atchuthan ........

0
Avatar

Emipro Technologies Pvt. Ltd. India

--Emipro Technologies Pvt. Ltd.--
7898
| 7 8 10
Rajkot, India
--Emipro Technologies Pvt. Ltd.--

Emipro has been providing a wide range of business solutions in the domain of ERP & eCommerce. We take pride in serving 1000s of contented customers across the globe with strong roots in the US, Europe & India. Being a Certified Odoo Gold Partner in India as well as the United States, we bring our rich professional experience and unrivaled technical competence to help our customers obtain efficient and cost-effective business solutions in Odoo. With our team of 50+ Odoo Experts and highly experienced business analysts, we serve our customers which are companies of all sizes, ranging from start-ups to large enterprises. 

Our ERP Services:

  • Business Need Analysis & GAP Analysis

  • ERP Migration

  • Odoo Consultancy

  • Odoo Implementation & Customization

  • Odoo Training & Support

  • Odoo Website & eCommerce Development

  • Odoo Integration (Marketplaces, eCommerce platforms, Shipping Carriers, Payment Gateways etc.)

Our Achievements:


Reach Us:

Website: www.emiprotechnologies.com

Email: info@emiprotechnologies.com

Skype: emiprotech

Emipro Technologies Pvt. Ltd. India
12/3/14, 12:44 AM

Hello Libu

d_frm_obj = datetime.datetime.strptime(date_from, DEFAULT_SERVER_DATETIME_FORMAT)
d_to_obj = datetime.datetime.strptime(date_to, DEFAULT_SERVER_DATETIME_FORMAT)

diff = d_to_obj - d_frm_obj

hours = (diff.seconds)/ 3600
print hours

diff_days = diff.days
print diff_days

days_hours = diff_days * 24
print days_hours

total_hours = days_hours + hours
print total_hours

Hope this helps !!

Ask a Question
Writer
1559
Odoo
Keep Informed
2 follower(s)
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