Information générale
Catégorie:
Codage, syntaxe et commandes
>I have the need to calculate the timespan in years between 2 dates. Getting the number of days between is no problem; figuring out how many years 1426 days is is another question. I am able to get fairly close using days/365.25 but I don't think this is going to cut it. I am aware of the financial terms 30/360 and Actual/Actual, but don't know how to use these methods to calculate duration. Anybody have a clue?
Erik -
If you are truly calculating financial time spans (to calculate accrued interest on such things as fixed income securities (bonds, etc.), there are VERY exact definitions of how do to that.
I did this YEARS ago when writing a portfolio management system, and seem to recall that there is a pseudo-government organization (try NASD or SEC) that publishes a document that tells you exactly how to count days (and calculate interest). You literally must do it by counting an exact number of days - in some cases, the accrued interest on two consecutive days can be the same value. There were some bonds that counted on a 360-day year, and others that counted on a 365-day year. All very confusing.
Don
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement