判断是否是中国的工作日

import datetime
from  chinese_calendar import is_workday
def get_last_month_start_end(num):
    today = datetime.date.today()
    last_day_of_last_month = datetime.date(today.year,today.month,1)- datetime.timedelta(num)
    return last_day_of_last_month

last_day_of_last_month = str(get_last_month_start_end(2))
date_list = str(last_day_of_last_month).split("-")
da = datetime.date(int(date_list[0]),int(date_list[1]),int(date_list[2]))
boll = is_workday(da)
print(boll)

 

posted @ 2022-02-11 11:11  拷贝达人  阅读(70)  评论(0编辑  收藏  举报