from datetime import datetime, timedelta
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'))
sql2 = "select count(1) from icsys.ft_be_chip_override_t where hive_partition_content="
sql_insert_raw_date = ''''''
while begin_date <= end_date:
date_str = begin_date.strftime("%Y-%m-%d")
date_list.append(date_str)
sql2_query = sql2 + '\'' + date_str + '\''
print(" %s" % sql2_query)
begin_date += timedelta(days=1)
return date_list
getBetweenDay('2020-06-18', '2021-01-01')