I am using Tkinter to build a Corona Travel History Questionnaire.
The front end has options to select a particular date - \" D-Day Cronoa Confirmed\". Once the D-day is
Using the datetime module you can find the last thirty days from any given date.
For example, the code:
first_date = datetime.datetime.now() - datetime.timedelta(30)
will give you the start period of this 30-day window. From there you simply need to fill in the gaps.
datetime and timedelta are made for this.
from datetime import datetime, timedelta
start = datetime(2020, 1, 1)
for day in range(1, 31):
print(start-timedelta(days=day))