Answer the question
In order to leave comments, you need to log in
How to add value to Python Datetime?
I need to add 5 to the hour value, how can I do that?
from datetime import datetime, timedelta
now = datetime.now()
now = str(datetime.strftime(datetime.now(), "%Y-%m-%d %H:%M:%S"))
plus = str (timedelta(hours=5))
print(now)
print(str(now+plus))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question