CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I created one salary rule for seniority(antiquity: Number of days the employee has done in company)
i have the join date (from contract) and today of the employee..
what i want is how many days between that two date.
ie: number of working days between two dates
Please help me.
Using below code you will get number of days.
from datetime import datetime
format = '%Y-%m-%d'
start_date = '2015-12-01' -> Take your date field1
end_date = '2015-12-31' -> Take your date field2
start = datetime.strptime(start_date, format)
end = datetime.strptime(end_date, format)
daysDiff = str((end-start).days) -> will gives you 30 days
daysDiff = str((end-start).days + 1) -> will gives you 31 days
Hope this code help for you !!!
Thanks & Regards,
Ankit H Gandhi.
About This Community
Odoo Training Center
|Asked: 12/1/15, 3:43 AM|
|Seen: 773 times|
|Last updated: 12/1/15, 6:30 AM|