I can do this very easy with the datediff("d",date1,date2) function which use 365 days per year. But I want to use the same function that excel uses which is the 360 days per year. Thanks in advance for your help.

When you compare two dates and find the difference in the number of days, it doesn't matter how many days are in a year. All that matters is the number of day difference between the dates.

That is true. But for purpose of this application, accountants use a 360 day year which is 12 months of 30 days each. Excel has a function for this called Days360. I need to be able to perform the same function in asp.net.

Roll your own, I'm afraid. I think the logic is pretty easy. Probably a combination of the datediff in months and the day of the month. Something like 1/1/05, 3/7/05 is 2 months difference (2x30) plus 7-1 = 66 days. Not sure what to do when you have1/31/05. Put
all the possible types of cases in Excel and reverse-engineer its formula.

You are absolutely correct. But when calculation the days between 11/01/2003 and 11/01/2004, the amount of days will be 360 with the below code. Therefore, every month will have 30 days. This is what alot of accounting programs use instead of your typical 365
days per year.

## rayfusion

Member

105 Points

21 Posts

## How can I Calculate days between 2 dates using a 360 day year.

Jun 15, 2005 03:48 PM|rayfusion|LINK

## crpietschman...

Participant

917 Points

221 Posts

## Re: How can I Calculate days between 2 dates using a 360 day year.

Jun 16, 2005 02:21 AM|crpietschmann|LINK

Blog: http://pietschsoft.com | Web.Maps.VE - ASP.NET AJAX Bing Maps Control

## rayfusion

Member

105 Points

21 Posts

## Re: How can I Calculate days between 2 dates using a 360 day year.

Jun 16, 2005 12:43 PM|rayfusion|LINK

That is true. But for purpose of this application, accountants use a 360 day year which is 12 months of 30 days each. Excel has a function for this called Days360. I need to be able to perform the same function in asp.net.

## PDraigh

Contributor

3550 Points

710 Posts

## Re: How can I Calculate days between 2 dates using a 360 day year.

Jun 16, 2005 03:28 PM|PDraigh|LINK

## rayfusion

Member

105 Points

21 Posts

## Re: How can I Calculate days between 2 dates using a 360 day year.

Jun 16, 2005 05:58 PM|rayfusion|LINK

http://www.vbcity.com/forums/topic.asp?tid=21264

## shahramk

Participant

1847 Points

368 Posts

## Re: How can I Calculate days between 2 dates using a 360 day year.

Jun 16, 2005 06:06 PM|shahramk|LINK

For example, There will always be two days between the 14th and the 16th of any month.

Now, if you need to display that information in Month/Day format , yeah, you would need to create your own formula.

## rayfusion

Member

105 Points

21 Posts

## Re: How can I Calculate days between 2 dates using a 360 day year.

Jun 16, 2005 07:26 PM|rayfusion|LINK