The essence of the question: It is necessary to add the current time, with the data that comes from the database, on the ID, with the timedelta type. For example, 2019-02-05 12: 47: 28.593000 and 00:01:00 and get 2019-02-05 12: 48: 28.593000. The data that comes from the database is static, but I would like not to resort to hardcode and work with the object dynamically. I would be grateful for the help, or for the link to the source with the solution of a similar issue.

    1 answer 1

    from datetime import datetime, timedelta >>> a = datetime.now() >>> str(a) '2019-04-25 00:14:22.514835' >>> b = timedelta(hours=2, seconds=15) >>> str(b) '2:00:15' >>> str(a+b) '2019-04-25 02:14:37.514835'