天数的移动根据i的值变化而变化,负数为向前移动,正数为向后移动
import datetime
from time import strftime
time_os = datetime.datetime.now()
print(time_os)
now_time = strftime("%Y%m%d")
rain_list = []
for i in range(10):
time = (time_os + datetime.timedelta(days=i)).strftime("%Y%m%d")
print(time)