Difference between two time values in minutes
조회 수: 21 (최근 30일)
이전 댓글 표시
I have two time point and was trying to calculate their difference to be converted to minutes.
t1 = 08/24/2010 13:21:47.030
t2 = 08/24/2010 14:13:09.118
I tried caldiff, duration, datetime and didn't work. Can you help?
dt = between(t1,t2,"minutes")
댓글 수: 1
Stephen23
2022년 2월 11일
Do NOT use deprecated DATENUM or DATEVEC or DATESTR.
t1 = '08/24/2010 13:21:47.030';
t2 = '08/24/2010 14:13:09.118';
dt = datetime([t1;t2],'InputFormat','M/d/u H:m:s.SSS')
d = dt(2)-dt(1)
m = minutes(d)
참고 항목
카테고리
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!