I want to find out the following: given a date (datetime object), what is the corresponding day of the week?
datetime
For instance, Sunday is the first day, Mond
Here's a simple code snippet to solve this problem
import datetime intDay = datetime.date(year=2000, month=12, day=1).weekday() days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] print(days[intDay])
The output should be:
Friday