Commit e683b114 authored by 高雅喆's avatar 高雅喆

space to tab

parent 69aa7b29
......@@ -36,18 +36,18 @@ def get_yesterday_date():
yesterday = yesterday.strftime("%Y-%m-%d")
return yesterday
def getBetweenDay(begin_date,end_date):
def get_between_day(begin_date,end_date):
#获取指定时间范围内的date
"""
type begin_date : str eg:'2018-08-29'
type end_date : str eg:'2018-09-01'
rtype : list eg:['2018-08-29','2018-08-30','2018-08-31','2018-09-01']
"""
date_list = []
begin_date = datetime.datetime.strptime(begin_date, "%Y-%m-%d")
end_date = datetime.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 += datetime.timedelta(days=1)
return date_list
\ No newline at end of file
date_list = []
begin_date = datetime.datetime.strptime(begin_date, "%Y-%m-%d")
end_date = datetime.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 += datetime.timedelta(days=1)
return date_list
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment