Python - Exclude weekends between two Dates

前端 未结 4 452
刺人心
刺人心 2021-01-13 11:08

I want to calculate the difference between the two dates but want to exclude the weekends from it . Below is the format of dates :

CreateDate  - 2017-08-29 1         


        
4条回答
  •  春和景丽
    2021-01-13 11:12

    Run a while loop that keeps adding a timedelta of +1 day to create_date. Keep track of weekday vs. weekend in a separate counter.

提交回复
热议问题