Program - Add week (7 days) and 12 hours to a given date


Topic: Program - Add week (7 days) and 12 hours to a given date

Solution

from datetime import datetime, timedelta
given_date = datetime(2020, 3, 22, 10, 00, 00)
days_to_add = 7
res_date = given_date + timedelta(days=days_to_add, hours=12)
print(res_date)



List all Python Programs