import datetime
hours=24*7
for hour in range(hours):
start=datetime.datetime.strptime("2020-12-12","%Y-%m-%d")+datetime.timedelta(hours=hour)
end=start+datetime.timedelta(hours=1)
start=start.strftime("%Y-%m-%dT%H:%M:%SZ")
end=end.strftime("%Y-%m-%dT%H:%M:%SZ")
print(start,end)
import datetime
batchs=24*7*2
for batch in range(batchs):
    start=datetime.datetime.strptime("2020-12-12","%Y-%m-%d")+datetime.timedelta(hours=batch*0.5)
    end=start+datetime.timedelta(hours=0.5)
    start=start.strftime("%Y-%m-%dT%H:%M:%SZ")
    end=end.strftime("%Y-%m-%dT%H:%M:%SZ")
    print(start,end)

 

发表评论

邮箱地址不会被公开。 必填项已用*标注