Time and frequency from dates
[TFactors, F] = date2time(Settle, Maturity, Compounding, Basis,
Settlement date. A vector of serial date numbers or date strings.
A vector of serial maturity dates.
Scalar value representing the rate at which the input zero rates were compounded when annualized. This argument determines the formula for the discount factors:
(Optional) Day-count basis of the instrument. A vector of integers.
For more information, see basis.
(Optional) End-of-month rule. A vector. This rule applies
[TFactors, F] = date2time(Settle, Maturity, Compounding,
Basis, EndMonthRule) computes time factors appropriate
to compounded rate quotes between the settlement and maturity dates.
TFactors is a vector of time factors.
F is a scalar of related compounding frequencies.
date2time is the inverse of
The difference between
date2time counts full periods as a whole
integer, even if the number of actual days in the periods are different.
not count full periods. For example,
yearfrac('1/1/2000', '1/1/2001', 9)
ans = 1.0167
ISMA) will calculate 366/360 = 1.0167. So, even if the dates have
the same month and date, with a difference of 1 in the year, the returned
value may not be exactly 1. On the other hand,
calculate one full year period:
date2time('1/1/2000', '1/1/2001', 1, 9)
ans = 1