我正在开发一个Odoo薪资模块,我有一个问题。
委内瑞拉有一项名为“社会保障”的工资规则,其公式是:
(工资* 12) / 52) * 0.04) *
在Python27中,有方法计算两个日期之间的星期一数量吗?
发布于 2016-09-29 03:38:57
def num_mondays_between( start, end):
num_weeks, remainder = divmod( (end-start).days, 7)
if start.weekday() == 0: # start is monday
# one monday for each week between plus start
return num_weeks + 1
elif ( 7 - start.weekday() ) <= remainder:
# the closer start is to a monday, a smaller remainder has a monday
return num_weeks + 1
else:
return num_weekshttps://stackoverflow.com/questions/39760703
复制相似问题