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
This is a solution if the date is a datetime object.
import datetime def dow(date): days=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] dayNumber=date.weekday() print days[dayNumber]