Display elapsed time in hours, minutes, and seconds
조회 수: 40 (최근 30일)
이전 댓글 표시
Since now datestr is discouraged, I would like to use datetime to display elapsed time in hours, minuts and seconds. My previous code was
datestr(toc, 'HH:MM:SS')
How can I replace this with a command using datetime?
댓글 수: 0
채택된 답변
chicken vector
2023년 4월 19일
time = seconds(4321)
time.Format = 'hh:mm:ss'
댓글 수: 6
chicken vector
2023년 4월 19일
the command seconds is returning an instance of the class duration, that's why you can include the 'Format' command in duration, but not in seconds.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!