Financial Toolbox
  Go to function:
    Search    Help Desk 
datemnth    Examples   See Also

Date of day in future or past month.

Syntax

Arguments

d1
Start date. Enter as serial date number or date string.
mm
Number of months in future (positive) or past (negative). An integer.
df
Day flag: 0 = day of month in d corresponds to the day of month in the start date or the last day of d, as appropriate (default); 1 = day of month in d is the first day of month; 2 = day of month in d is last day of month. This flag has no effect if eom applies and is set to 1.
basis
Day-count basis: 0 = actual/actual (default), 1 = 30/360,
2 = actual/360, 3 = actual/365.
eom
End-of-month flag. This flag applies only when the start date d1 is an end-of-month date. 0 = ignore flag (default), or 1 = force d to the end-of-month. When eom applies and is set to 0, the setting of df controls the day of month in d. When eom applies and is set to 1, d is always the last day of the month.

Description

d = datemnth(d1, mm, df, basis, eom) returns the serial date number d for a date mm months in the future or past.

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 d1 is an N-row character array of date strings, then mm must be an N-by-1 vector of integers or a single integer. d is then an N-by-1 vector of date numbers.

Use the function datestr to convert serial date numbers to formatted date strings.

Examples

See Also

datestr, datevec, days360, days365, daysact, daysdif, wrkdydif



[ Previous | Help Desk | Next ]