import datetime
示例加班计算
def calculate_overtime(start_time, end_time, normal_end_time):
normal_end = datetime.datetime.strptime(normal_end_time, ‘%H:%M’)
end = datetime.datetime.strptime(end_time, ‘%H:%M’)
if end > normal_end:
overtime = (end – normal_end).seconds / 3600
else:
overtime = 0
return overtime
利唐i人事HR社区,发布者:HR_learner,转转请注明出处:https://www.ihr360.com/hrnews/20241240089.html