advance a given date by the given number of time units - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Finance : Date Arithmetic : Finance/AdvanceDate

Finance[AdvanceDate] - advance a given date by the given number of time units

Calling Sequence

AdvanceDate(date, n, units, calendar, opts)

AdvanceDate(n, units, calendar, opts)

Parameters

date

-

a string containing a date specification in a format recognized by ParseDate or a date data structure

n

-

integer; number of units

units

-

Days, Weeks, Months, or Years; time units

calendar

-

a name representing a supported calendar (e.g. Toronto, NewYork) or a calendar data structure created using the Calendar constructor

opts

-

(optional) equation(s) of the form option = value where option is one of convention or output; specify options for the AdvanceDate command

Description

• 

The AdvanceDate command advances a given date by the given number of time units. If the advanced date falls on a holiday according to the given calendar it will be adjusted to the appropriate business day with respect to the given convention.

• 

The parameter date must be a date specified in any of the formats recognized by the ParseDate command. If this parameter is missing, the global evaluation date is used.

• 

The parameter units specifies the time units in which the increment is measured. The number of units n can be either positive or negative.

• 

The parameter calendar must be either a name representing a supported calendar (e.g. Toronto, NewYork) or a calendar data structure created using the Calendar constructor.

Examples

withFinance:

AdvanceDateFebruary 6, 2007,10,output=formatted,convention=Unadjusted

February 16, 2007

(1)

AdvanceDateFebruary 6, 2006,100,output=formatted

May 17, 2006

(2)

AdvanceDateFebruary 6, 2006,1,Weeks,output=formatted

February 13, 2006

(3)

AdvanceDateFebruary 6, 2006,1,Years,output=formatted

February 6, 2007

(4)

AdvanceDateFebruary 6, 2006,5,output=formatted

February 1, 2006

(5)

date:=AdvanceDateFebruary 6, 2006,5,output=data

date:=February 1, 2006

(6)

datemonthDay

1

(7)

datemonth

2

(8)

dateyear

2006

(9)

Note that last command returned a date data structure. It is printed as a string.

lprintAdvanceDateFebruary 6, 2006,5,output=data

Record('monthDay' = 1, 'month' = 2, 'year' = 2006, 'format' = "%B %e, %Y", 'ModulePrint' = proc (m) Finance:-FormatDate(m) end proc)

See Also

Finance[AddHoliday], Finance[AdjustDate], Finance[Calendar], Finance[Calendars], Finance[IsBusinessDay], Finance[IsEndOfMonth], Finance[IsHoliday], Finance[JoinBusinessDays], Finance[JoinHolidays], Finance[RemoveHoliday]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam