Help

4

calculation date

Avatar
yusuf

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
3 Answers
3
Avatar
yusuf
Best Answer

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

Avatar
Discard
1
Avatar
Ivan
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
0

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