return the interval between two dates as a fraction of the year - Maple Help

Online Help

All Products    Maple    MapleSim


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

Finance[YearFraction] - return the interval between two dates as a fraction of the year

Calling Sequence

YearFraction(todate, daycounter)

YearFraction(fromdate, todate, daycounter)

Parameters

fromdate

-

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

todate

-

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

daycounter

-

(optional) day counter or the name of a day counting convention

Description

• 

The YearFraction command returns the period between fromdate and todate as a fraction of the year calculated according to the day counting convention specified by daycounter. If no day counter is specified, the default one will be used.

• 

See DayCounter or CalendarsAndDayCounters for a detailed description of the supported day count conventions and additional examples.

Examples

withFinance:

YearFractionDec-20-2005,Nov-05-2006

0.8767123288

(1)

YearFractionDec-20-2005,Nov-05-2006,ISMA

0.9166666667

(2)

YearFractionDec-20-2005,Nov-05-2006,Simple

0.8750000000

(3)

YearFractionDec-20-2005,Nov-05-2006,OneDay

1.

(4)

DC:=Finance:-DayCounterOneDay:

YearFractionDec-20-2005,Nov-05-2006,DC

1.

(5)

SetEvaluationDateNovember 17, 2006:

EvaluationDate

November 17, 2006

(6)

YearFractionDecember 01, 2007,December 01, 2008

1.000232053

(7)

YearFractionDecember 01, 2007,December 01, 2008,Thirty360European

1.

(8)

YearFractionDecember 01, 2008

2.038588218

(9)

YearFractionDecember 01, 2008,Thirty360European

2.038888889

(10)

See Also

Finance[DayCount], Finance[DayCounter], Finance[FormatDate], Finance[ParseDate]


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