Click here to Skip to main content
Licence 
First Posted 13 Sep 2006
Views 28,952
Bookmarked 15 times

Calculate Financial days between dates

By | 13 Sep 2006 | Article
How to calculate the difference between two dates using the Financial 360/360 year

Introduction

In some case for some financial instruments the difference between two dates has to be calculated in a special way...Not on a real 365-6 year, but on a financial constant year of 360 days. It means that in this case each month has 30 days (30days*12months=360days). The function to perform this calculation exist in Excel (DAYS360), but its not so comfortable to use it. So I preferred to create my personal formula...

Which is the trick?

It's very easy to understand the concept behind... You have to consider that an year is composed by 365.2422 days. It means that every 4 year a LEAP year happens. The financial year is of 360 days. The delta is of 5.2422 days. In this way you can perform the normal date difference calculation and the result has to be multiplied for the conversion factor that reduce a normal day to a day of an year 360 days long. In practice the calculation has to be 5.2422/365=0.985637808219178 (conversion factor).

Private Const Days360ConversionFactor As Double = 0.985637808219178

Now the only action you have to do is to keep the calculated usual date difference

Dim</FONT> DifferenceInDaysValue As Double = Me.EndPeriodDate.Value.Subtract(Me.StartPeriodDate.Value).Days

and multiply it per the conversion factor (that couls be assumed to be a constant).

This code could be easy implemented into a class or better into a financial dll to improve its reusability and deployment...

Now the DAYS360 exist also in Visual Studio .NET!!!

¦-D

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

CresciF

Software Developer (Senior)

Switzerland Switzerland

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Generalfeb Pinmemberswapnamurrey1:02 28 Feb '07  
Generaldaycount conventions PinmemberStefano Guazzi4:48 19 Sep '06  
GeneralMinor Correction PinmemberMackay_S14:02 18 Sep '06  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 13 Sep 2006
Article Copyright 2006 by CresciF
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid