Next: , Previous: , Up: Octave Functions and Scripts   [Contents][Index]


5.2 addtodatefinancial

Function File: [newdatenum newdatevec] = addtodatefinancial(valdate, arg1, arg2, arg3)

Add or subtract given years, months or days to a given input date. End of month of input date will be preserved if no days are added. Both datenum and datevec format are returned. Explicit specification of years, months, days:

Implicit specification of value and unit:

Single date input possible only. Example call:

[newdatenum newdatevec] = addtodatefinancial('31-Mar-2016', 1, 'years')
newdatenum =  736785
newdatevec = [2017 3 31]
[newdatenum newdatevec] = addtodatefinancial('31-Mar-2016', -1, -6, -4)
newdatenum =  735869
newdatevec = [2014 9 27]

See also: addtodate.