def convert_timedelta(duration):
    days, seconds = duration.days, duration.seconds
hours = days * 24 + seconds // 3600
minutes = seconds % 3600 // 60
seconds = seconds % 60
return hours, minutes, seconds
td = datetime.timedelta(2, 7743, 12345)
hours, minutes, seconds = convert_timedelta(td)
print('{} minutes, {} hours'.format(minutes, hours))
How to convert datetime.timedelta to minutes, hours in Python?