반응형
두 개의 날짜 시간을 빼서 timedelta 객체를 얻었습니다. 추가 계산을 위해이 값이 부동 소수점으로 필요합니다. All that I've found enables the calculation with floating-points, but the result 여전히 timedelta 객체입니다.
time_d = datetime_1 - datetime_2
time_d_float = float(time_d)
작동하지 않습니다.
해결 방법
time_d_float = time_d.total_seconds()
참조 페이지 https://stackoverflow.com/questions/21414639
반응형
'파이썬' 카테고리의 다른 글
파이썬 Python Matplotlib - how to specify values on y axis? (0) | 2020.12.24 |
---|---|
파이썬 Python 요청-예외 유형 : ConnectionError-try : except가 작동하지 않음 (0) | 2020.12.24 |
파이썬 Python을 사용하여 MS Office 매크로를 프로그래밍 하시겠습니까? (0) | 2020.12.24 |
파이썬 matplotlib에서 datetimes로 x 축 범위를 어떻게 변경합니까? (0) | 2020.12.24 |
파이썬 Pandas : 다단계 열 이름 (0) | 2020.12.24 |
댓글