Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Datetime timedelta solution in Clear category for The First Working Day by swagg010164
import datetime
def vacation(date, days):
from_date = datetime.datetime.strptime(date, "%Y-%m-%d")
for k in range(10):
work = from_date + datetime.timedelta(days=days + k)
if work.weekday() not in (5, 6):
return work.strftime("%Y-%m-%d")
May 3, 2020
Comments: