python 获取近几周日期

import datetime
def get_Next_day(count):
today = datetime.datetime.today().date()
for i in range(count):
next_week_start = today + datetime.timedelta(days=(6 - today.weekday()-6) - 7 * i)
next_week_end = today + datetime.timedelta(days=(6-today.weekday())-7 * i)
print(str(next_week_start)+'--'+str(next_week_end))


print(get_Next_day(5))
原文地址:https://www.cnblogs.com/javahepeng/p/14436796.html