1import datetime
2
3today = datetime.date.today()
4
5next_week = today + datetime.timedelta(days=7)
1from datetime import timedelta
2# Create a delta time
3datetime_delta = timedelta(weeks = 1, days = 2, hours = 4, minutes = 10,
4 seconds = 8, milliseconds = 25, microseconds = 8)
5print("Delta datetime :- ", datetime_delta)
6>>> Delta datetime :- 9 days, 4:10:08.025008
1from datetime import date
2f_date = date(2014, 7, 2)
3l_date = date(2014, 7, 11)
4delta = l_date - f_date
5print(delta.days)
6
7