#每日一读 返回两个日期之前的所有日期
作者:互联网
from datetime import timedelta, date def daterange(start, end): print([start + timedelta(n) for n in range(int((end - start).days))]) daterange(date(2020, 10, 1), date(2020, 10, 5)) #[datetime.date(2020, 10, 1), datetime.date(2020, 10, 2), datetime.date(2020, 10, 3), datetime.date(2020, 10, 4)]
标签:返回,10,timedelta,datetime,start,日期,2020,date,一读 来源: https://www.cnblogs.com/ai594ai/p/15649309.html