내용으로 건너뛰기
Out of the Box
사용자 도구
로그인
사이트 도구
검색
도구
문서 보기
이전 판
Fold/unfold all
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
추적:
timedelta
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== timedelta ====== <code python> start = datetime.datetime.now() ... # process code goes here end = datetime.datetime.now() # we get the total runtime in seconds runtime = (end - start).seconds # we will assume 30000 f'{datetime.timedelta(seconds=runtime)}' </code> <code python> # https://towardsdatascience.com/lesser-known-python-features-f87af511887 start = datetime.datetime.now() ... # process code goes here end = datetime.datetime.now() # we get the total runtime in seconds runtime = (end - start).seconds # we will assume 30000 # how many hours are in these secs, what are the remaining secs? hours, remainder = divmod(runtime, 3600) # now how many minutes and seconds are in our remainder? mins, secs = divmod(remainder, 60) print("{:02d}:{:02d}:{:02d}".format(hours, mins, secs)) </code>
timedelta.txt
· 마지막으로 수정됨: 2024/03/23 02:38 저자
127.0.0.1
문서 도구
문서 보기
이전 판
역링크
Fold/unfold all
맨 위로