dt2 = 1x3 duration array
2.5386 days 3.7386 days 4.9386 daysCalculate Elapsed Time in Calendar UnitsUse the between function to find the number of calendar years, months, and days
elapsed between two dates.t1 = datetime('today')t1 = datetime
13-Apr-2019t2 = t1 + calmonths(0:2) + caldays(4)t2 = 1x3 datetime array
17-Apr-2019 17-May-2019 17-Jun-2019dt = between(t1,t2)dt = 1x3 calendarDuration array
4d 1mo 4d 2mo 4dSee Also
between | caldiff | diff7 Dates and Time