between
R2026bCalendar math differences
Syntax
Description
The between function returns the calendar differences
between two datetime arrays. When between calculates the calendar
difference between two datetime values, it takes into account leap years, Daylight
Saving Time shifts, and the differing lengths of calendar months. To calculate
differences as exact fixed-length durations, use subtraction instead, as in dt
= t2 - t1.
returns the differences between datetime values in terms of the specified calendar
or time components.dt = between(t1,t2,components)
sets the arithmetic method of the returned calendar duration
dt = between(t1,t2,components,ArithmeticMethod=arithmeticMethod)dt.
Examples
Input Arguments
Output Arguments
Tips
To compute differences between datetime values in
t1andt2as exact, fixed-length durations, uset2-t1.
Extended Capabilities
Version History
Introduced in R2014bSee Also
minus | diff | caldiff | calendarDuration