date to day of week python code example
Example 1: python datetime weekday
from datetime import datetime
date_str='10-12-20'
datetime_object = datetime.strptime(date_str, '%m-%d-%y')
datetime_object.weekday()
Example 2: python datetime get date one week from today
>>> import datetime
>>> datetime.datetime.now() + datetime.timedelta(days=7)