belongs to collection: Python Date and Time Exercises
Given:
# 2020-03-22 10:00:00 given_date = datetime(2020, 3, 22, 10, 0, 0)
Expected output:
2020-03-29 22:00:00
Solution:
from datetime import datetime, timedelta given_date = datetime(2020, 3, 22, 10, 00, 00) print("Given date") print(given_date) days_to_add = 7 res_date = given_date + timedelta(days=days_to_add, hours=12) print("New Date") print(res_date)
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Solution:
need an explanation for this answer? contact us directly to get an explanation for this answer