I have three variables:
week_no = 2 day = 'Fri' year = 2021
I need to locate the date by using these variables and output as a datetime.date object.
datetime.date
Thanks.
Following code:
datetime.datetime.strptime(f'{week_no} {day} {year}', '%U %a %Y')
Return following result:
datetime.datetime(2021, 1, 15, 0, 0)
2.1m questions
2.1m answers
60 comments
57.0k users