def days_hours_minutes(td):
return td.days, td.seconds//3600, (td.seconds//60)%60
https://stackoverflow.com/questions/2119472/convert-a-timedelta-to-days-hours-and-minutes
Convert a timedelta to days, hours and minutes
I've got a timedelta. I want the days, hours and minutes from that - either as a tuple or a dictionary... I'm not fussed. I must have done this a dozen times in a dozen languages over the years but
stackoverflow.com
'[공부용]참고 사이트 모음 > [python]' 카테고리의 다른 글
[python] watchdog 멀티 프로세싱 (0) | 2021.05.31 |
---|---|
[python] Flask (0) | 2021.05.24 |
[python] 파이썬 플라스크 파일 업로드 (0) | 2021.05.18 |
[python] asyncio 특정 시간에 작동하도록 하기 (0) | 2021.05.18 |
[python] CORS Error 해결법 - Flask 플라스크 예시 (0) | 2021.05.18 |