I need some help with my code. I have got an error when I am trying to add 30 mins with getTime3
.
import datetime
import time
getTime3 = '12:30AM'
dt3 = time.strptime(getTime3, '%I:%M%p')
test_time = dt3 + datetime.timedelta(minutes = 30)
print test_time
The error are jumping on this line:
test_time = dt3 + datetime.timedelta(minutes = 30)
Here is what dt3
show the struct_time object:
time.struct_time(tm_year=1900, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=30, tm_sec=0, tm_wday=0, tm_yday=1, tm_isdst=-1)
Here is what test_time
show the object without the dt3
:
0:30:00
Can you please help me with how I could correct the error to allow me to add the minutes?