import datetime today = datetime.datetime.today().date() print today.weekday() for i in range(10): next_week_start = today + datetime.timedelta(days=today.weekday() - 15 - 7 * i) next_week_end = today + datetime.timedelta(days=today.weekday() - 9 - 7 * i) print next_week_start, next_week_end
4 2019-08-26 2019-09-01 2019-08-19 2019-08-25 2019-08-12 2019-08-18 2019-08-05 2019-08-11 2019-07-29 2019-08-04 2019-07-22 2019-07-28 2019-07-15 2019-07-21 2019-07-08 2019-07-14 2019-07-01 2019-07-07 2019-06-24 2019-06-30 Process finished with exit code 0
后N周时间同理。
原文地址:https://www.cnblogs.com/qinghuaL/p/11473806.html
时间: 2024-11-04 06:46:36