Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
import datetime
mytime = datetime.datetime.now().time() # TimeField - инстанс datetime.time
myint = 10 # IntegerField - инстанс int
result = (
datetime.datetime.combine(datetime.date(1,1,1), mytime) + datetime.timedelta(minutes=myint)
).time()
print(mytime, result)
# 20:00:00.193440 20:10:00.193440
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question