calculating the difference between 2 dates
이전 댓글 표시
Dear all,
I would like to calculate the difference between the dates say,
20/11/08 and 12/10/2011 in weeks and in months
cheers
채택된 답변
추가 답변 (1개)
there's something better now since 2014 release I believe:
w = between(startRange,endRange,'weeks')
y = between(startRange,endRange,'years')
m = between(startRange,endRange,'months')
댓글 수: 2
Peter Perkins
2018년 3월 15일
Indeed:
>> between(datetime('20-Nov-2008'),datetime('12-Oct-2011'),{'weeks' 'months'})
ans =
calendarDuration
34mo 3w
Rosanna
2018년 10월 11일
Hi all I have to compute the occurrence time (days from the starting date) of a large number (eg N=1000) of events, for which I have the Year, Month, Day, Hour, Minute in numerical format (eg 2008, 05, 23, 08, 34). How can I proceed? Thanks Rosanna
카테고리
도움말 센터 및 File Exchange에서 Time Series Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!