python 计算两个日期直间连续日期列表
import time from datetime import datetime def getBetweenDay(begin_date,end_date): date_list = [] begin_date = datetime.strptime(begin_date, "%Y-%m-%d") end_date = datetime.strptime(end_date, "%Y-%m-%d") while begin_date <= end_date: date_str = begin_date.strftime("%Y-%m-%d") date_list.append(date_str) begin_date += timedelta(days=1) return date_list
res_list = getBetweenDay('2020-01-01','2020-03-09')