Timedelta
Timedelta class represent not any particular date or time, but it represents a span of time. This class will be helpful when you need to run some math on date and time. Say what will be this day on after few weeks or what will be this day in future year.
Following example will make it clear
from datetime import date from datetime import timedelta print(f'todays date {date.today()} after 1 year will be {date.today()+ timedelta(days=365)}') Output todays date 2020-06-27 after 1 year will be 2021-06-27
Here I used the f.string to construct the message , the timedelta represent one year, 365 days. You can find what will be the date before few weeks back using date -timedelta(weeks=4)