This question has been flagged
3 Replies
3332 Views

I am newbie in odoo 8 , I add a date field entry and exit date and how to calculate the date of entry and exit dates

Avatar
Discard
Author Best Answer

Mr.achuthan I am still confused with answer , Mr.achuthan could give a few examples of the answers above

Avatar
Discard
Best Answer

You use normal python library to do date calculation.  There are many python datetime libraries out there, but I would recommend that you use datetime with some improvement from dateutil if necessary.
 

Avatar
Discard
Best Answer

d_frm_obj = datetime.strptime(entry_date, DEFAULT_SERVER_DATETIME_FORMAT)
d_to_obj = datetime.strptime(exit date, DEFAULT_SERVER_DATETIME_FORMAT)
diff = d_to_obj - d_frm_obj
print diff.days  //provides days

https://www.odoo.com/forum/help-1/question/how-to-find-out-number-of-hours-between-two-datetime-object-69367#answer-69386

Avatar
Discard