import datetime
dt = datetime.datetime
now = dt.now()
now.strftime("%Y-%m-%d %H:%M:%S")
'2020-10-26 09:53:49'
now - datetime.timedelta(days=100)
2020-07-18 09:53:49.708843
(now - datetime.timedelta(days=100)).strftime("%Y-%m-%d %H:%M:%S")
'2020-07-18 09:53:49'
weeks = ["星期一","星期二","星期三","星期四","星期五","星期六","星期日"]
weeks[(now - datetime.timedelta(days=100)).weekday()]
'星期六'
now + datetime.timedelta(days=100)
datetime.datetime(2021, 2, 3, 9, 53, 49, 708843)
(now + datetime.timedelta(days=100)).strftime("%Y-%m-%d %H:%M:%S")
'2021-02-03 09:53:49'
weeks[(now + datetime.timedelta(days=100)).weekday()]
'星期三'
now + datetime.timedelta(+3)
(now + datetime.timedelta(+3)).strftime("%Y-%m-%d %H:%M:%S")
'2020-10-29 09:53:49'
(now + datetime.timedelta(-3)).strftime("%Y-%m-%d %H:%M:%S")
'2020-10-23 09:53:49'
(now + datetime.timedelta(hours=3)).strftime("%Y-%m-%d %H:%M:%S")
'2020-10-26 12:53:49'
(now + datetime.timedelta(minutes= -53)).strftime("%Y-%m-%d %H:%M:%S")
'2020-10-26 09:00:49'
(now - datetime.timedelta(seconds=48)).strftime("%Y-%m-%d %H:%M:%S")
'2020-10-26 09:53:01'
(now - datetime.timedelta(hours=1, seconds=1, days=1)).strftime("%Y-%m-%d %H:%M:%S")
'2020-10-25 08:53:48'