[공부용]참고 사이트 모음/[python]
[python] datetime.timedelta 를 일, 시간, 분으로 변환
bled
2021. 5. 20. 13:48
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