def convert_timedelta(duration):
    days, seconds = duration.days, duration.seconds
hours = seconds // 3600
minutes = seconds % 3600 // 60
seconds = seconds % 60
return days, hours, minutes, seconds
Как преобразовать datetime.timedelta в минуты, часы в Python?