SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы

Список вопросов Печать

Конвертация timedelta в дни, часы, минуты


Метки: python 

Ответы

RemiZOffAlex  Создано: 2016-11-14 21:16:21.939410  Обновлено: 2016-11-14 21:16:21.939410
def convert(mytime):
    from datetime import timedelta
    result = timedelta(minutes=mytime)
    return result.days, result.seconds//3600, (result.seconds//60)%60

Возможно будут интересны и другие вопросы