Jan-04-2023, 08:52 PM
(This post was last modified: Jan-05-2023, 05:31 PM by deanhystad.)
If you are measuring your runtime in seconds it might make more sense using datetime.fromtimestamp()
from datetime import datetime now = datetime.now().timestamp() runtime = 1 * 3600 + 22 * 60 + 14 # 1:22:14 seconds print(datetime.fromtimestamp(now)) print(datetime.fromtimestamp(now + runtime))
Output:2023-01-04 14:52:30.891579
2023-01-04 16:14:44.891579
If your runtime is a HH:MM:SS string, Yoriz's solution is a better choice.