Apr-15-2020, 02:47 AM
Don't try to add time() objects. Instead do your math with datetime() objects and then convert to time for display if you need.
#Write a Python program to add 5 seconds with the current time. import datetime t1 = datetime.datetime.now() # stays a datetime object print("Current time:", t1.time()) t=t1+datetime.timedelta(seconds = 5) print("After 5 Seconds:", t.time())