BDE 4.14.0 Production release
|
Provide stateless functions for PSA 30/360 end-of-month convention.
This component provides a struct
, bbldc::BasicPsa30360Eom
, that serves as a namespace for defining a suite of date-related functions used to compute the day count and year fraction between two dates as prescribed by the Public Securities Association (PSA) 30/360 day-count convention with end-of-month (eom) adjustments.
Given beginDate
and endDate
, let:
The max
function is required because Dl
has no February adjustment and simple differences like (19990228 - 19990228) produce -2 without max
.
Reference: PSA Standard Formulas, page SF-17
The year fraction is simply the day count divided by 360.
This section illustrates intended use of this component.
The following snippets of code illustrate how to use bbldc::BasicPsa30360Eom
methods. First, create two bdlt::Date
variables, d1
and d2
:
Then, compute the day count between the two dates:
Finally, compute the year fraction between the two dates: