输入日期判断是不是周末,是周末就返回最近的下周一日期,不是就返回输入日期
def work_day(date): if date.isoweekday() == 6: return date + timedelta(days=2) elif date.isoweekday() == 7: return date + timedelta(days=1) else: return date work_day(datetime.date(2020, 2, 1))
输入日期判断是不是周末,是周末就返回最近的下周一日期,不是就返回输入日期
def work_day(date): if date.isoweekday() == 6: return date + timedelta(days=2) elif date.isoweekday() == 7: return date + timedelta(days=1) else: return date work_day(datetime.date(2020, 2, 1))
Generate
More than just a code generator. A tool that helps you with a wide range of tasks. All in one place.
Function from Description
Text Description to SQL Command
Translate Languages
Generate HTML from Description
Code to Explanation
Fix invalid Code
Get Test for Code
Class from Description
Regex from Description
Regex to Explanation
Git Command from Description
Linux Command
Function from Docstring
Add typing to code
Get Language from Code
Time complexity
CSS from Description
Meta Tags from Description