Используем вызов datetime.timedelta(seconds=secs)
Пайтон код
boris@boris-All-Series:~/DATETIME$ cat addNSec.py
import datetime
def addSecs(tsc, secs):
» » » curr_date = datetime.datetime(100, 1, 1, tsc.hour, tsc.minute, tsc.second)
» » » curr_date = curr_date + datetime.timedelta(seconds=secs)
» » » return curr_date.time()
N = int(input("Add N seconds to datetime: "))
x = datetime.datetime.now().time()
y = addSecs(x, N)
print(x)
print(y)
boris@boris-All-Series:~/DATETIME$ python3 addNSec.py
Add N seconds to datetime: 24
11:22:02.011306
11:22:26
» - означает отступ