I'm struggling to add different amounts of seconds to a timestamp.
Let's suppose I want to add 1136 seconds to 2016-12-02 13:26:49
. This is what I have thus far:
import datetime
if __name__ == '__main__':
timestamp = datetime.datetime(year=2016, month=12, day=02, hour=13, minute=26, second=49)
offset = 1140
m, s = divmod(offset, 60)
h, m = divmod(m, 60)
I saw in another post something similar to what I want, but that is not for Python.
Should I use datetime.datetime.combine()
?
I have a big amount of data and I do not want to manually input the date for every sum.
Thank you in advance for any help.