programming-examples/python/Date/Program to add a month with a specified date.py

5 lines
222 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
from datetime import date, timedelta
import calendar
start_date = date(2014, 12, 25)
days_in_month = calendar.monthrange(start_date.year, start_date.month)[1]
print(start_date + timedelta(days=days_in_month))