In [1]:
from datetime import datetime
In [2]:
help(datetime.weekday)
In [3]:
today = datetime.today()
#setting today as a datetime object with today's date
In [4]:
datetime.weekday(today)
#today is Monday
Out[4]:
Line by line explanations of how things work in Python
from datetime import datetime
help(datetime.weekday)
Help on method_descriptor: weekday(...) Return the day of the week represented by the date. Monday == 0 ... Sunday == 6
today = datetime.today()
#setting today as a datetime object with today's date
datetime.weekday(today)
#today is Monday
0