I would like to add a certain time to a formatted time string in python. For this I tried the following
from datetime import datetime, timedelta timestemp_Original = '2021-07-13T00:15:00Z' timestemp_Added1 = '2021-07-13T00:15:00Z' + timedelta(minutes=15) timestemp_Added2 = timestemp_Original + datetime.timedelta(hours=0, minutes=15) but this leads to error messages (I took it from here How to add hours to current time in python and Add time to datetime). Can aynone tell me how to do this?
timedeltato a string. They always parse the string to adatetimeobject usingstrptimeand then they add thetimedeltadatetime?datetime.strptimefunction to parse it instead of reinventing the wheel.