2001-10-18 I want to calculate weekday e.g. Monday, Tuesday from the date given above. is it possible in python?
Here is one way to do this:
dt = '2001-10-18' year, month, day = (int(x) for x in dt.split('-')) answer = datetime.date(year, month, day).weekday()
There is the
isoweekday() methods for datetime objects.