Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
datetime from isoweekday
def date_from_day_of_week(isoweekday):
base = datetime.datetime.today()
return [d for d in [base - datetime.timedelta(days=x) for x in range(0, 7)] if d.isoweekday()==isoweekday][0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.