programming-examples/python/Date/Create 12 fixed dates from a specified date over a given period.py

10 lines
297 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
import datetime
def every_20_days(date):
print('Starting Date: {d}'.format(d=date))
print("Next 12 days :")
for _ in range(12):
date=date+datetime.timedelta(days=20)
print('{d}'.format(d=date))
dt = datetime.date(2016,8,1)
every_20_days(dt)