datemnth
Date of day in future or past month
Syntax
Description
determines
a date in a future or past month based on movement either forward
or backward in time by a given number of months.TargetDate = datemnth(StartDate,NumberMonths)
Any input 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 datetime, then
NumberMonths must be an
N-by-1 vector of integers or a single
integer. TargetDate is then an
N-by-1 vector of datetimes.
If StartDate is a string or date character vector,
TargetDate is returned as a serial date number. Use the
function datetime to convert serial date
numbers to formatted datetime arrays.
If StartDate is a datetime array, then TargetDate is
returned as a datetime array.
determines
a date in a future or past month based on movement either forward
or backward in time by a given number of months, using optional input
arguments for TargetDate = datemnth(___,DayFlag,Basis,EndMonthRule)DayFlag,Basis,
and EndMonthRule.