It depends what you want. if one wants whole timedelta in seconds then
.total_seconds()
should be used instead of .seconds
:add_time_2 = {"23:00:15", "6:15:15", "5:15:15"} total = sum(map(convert, add_time_2), timedelta()) print(total) # output -> 1 day, 10:30:45 print(total.total_seconds()) # output -> 124245.0 time = total.total_seconds() hours, reminder = divmod(int(time), 3600) minutes, seconds = divmod(reminder, 60) print(f'the total time is {hours}:{minutes}:{seconds}') # output -> the total time is 34:30:45
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.