between
Calendar math differences
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
)
Examples
Input Arguments
Output Arguments
Tips
To compute differences between datetime values in
t1
andt2
as exact, fixed-length durations, uset2-t1
.
Extended Capabilities
Version History
Introduced in R2014b
See Also
minus
| diff
| caldiff
| calendarDuration