Number of whole months between dates
MyMonths = months(StartDate,EndDate)
MyMonths = months(___,EndMonthFlag)
returns
the number of whole months between MyMonths
= months(StartDate
,EndDate
)StartDate
and EndDate
.
If EndDate
is earlier than StartDate
, MyMonths
is
negative.
Any input argument can contain multiple values, but if so, all
other inputs must contain the same number of values or a single value
that applies to all. For example, if StartDate
is
an n-row character array of character vector
dates, then EndDate
must be an n-row
character array of character vector dates or a single date. MyMonths
is
then an N
-by-1
vector of numbers.
returns
the number of whole months between MyMonths
= months(___,EndMonthFlag
)StartDate
and EndDate
using
an optional argument for EndMonthFlag
. If EndDate
is
earlier than StartDate
, MyMonths
is
negative.