day of date in python code example
Example 1: python date get day
import datetime
dt = datetime.datetime.today()
year = dt.year
month = dt.month
day = dt.day
Example 2: python datetime day of year
from datetime import datetime
day_of_year = datetime.now().timetuple().tm_yday