Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
3683 Weergaven

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
Annuleer
Auteur Beste antwoord

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

Avatar
Annuleer
Beste antwoord

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
Annuleer
Beste antwoord

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
Annuleer