# Calculate Financial days between dates

By , 13 Sep 2006

## 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

A list of licenses authors might use can be found here

 CresciF Software Developer (Senior) Switzerland Member
No Biography provided

Votes of 3 or less require a comment

 Search this forum Profile popups    Spacing RelaxedCompactTight   Noise Very HighHighMediumLowVery Low   Layout Open AllThread ViewNo JavascriptPreview   Per page 102550
 First Prev Next
 feb swapnamurrey 28 Feb '07 - 1:02
 this function does not taking 30 days in feb. suppose iwant to calculte difference between 01/feb/2007 to 08/july/2007 using the Financial 360/360 year feb 29 days march 30 days aprial 30days may 30days june 30days july 8days total---- 157 days but using this function it returns 154.745135890410946 Please check once   konda Sign In·View Thread·Permalink
 daycount conventions Stefano Guazzi 19 Sep '06 - 4:48
 The DAYS360 formula in Excel computes the number of conventional days between two dates under the 30/360 daycount convention[^], while your code only computes a rough approximation of it. Are you aware of this? Sign In·View Thread·Permalink
 Minor Correction Mackay_S 18 Sep '06 - 14:02