how to print previous 30 days from a date in python and the same in Tkinter

前端 未结 2 1502
你的背包
你的背包 2021-01-29 10:10

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

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-29 10:46

    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.

提交回复
热议问题