Link to home
Start Free TrialLog in
Avatar of eli411
eli411

asked on

Calculated the Date in C#

The system takes the current day you apply or check rates and adds the value in the Days to Close editor (30 days) to come up with an estimated closing date. From there, we figure out how many days are left in the month. If the estimated closing date falls on a Friday or the weekend, we moved the estimated closing date to the following Monday.
 
Using the application date or check rates date of 2/19/14, this means for your example, the average days to close is 30 which would put the closing date at March 20th. With a closing date of March 20th, the remaining days in the month would equal eight.

----Following is the code I had in C# but it is not calculating the Days Left In Month ----
---- It is calculating how many days left in a month ---

private state int retrieveInterestDays()
{
     var today = DateTime.Now;
     var day = today.Day;
     var daysinmonth = DateTime.DaysInMonth(today.Year, today.Month);

     return daysinmonth - day + 1;
}
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of eli411
eli411

ASKER

Let me try and see if it work or not!  Thanks.
Avatar of eli411

ASKER

Hi JamesBurger:
   The purpose of this function I want to find out how many business day left for the month after adding 30 days!  I am still testing it.
Avatar of eli411

ASKER

I've requested that this question be closed as follows:

Accepted answer: 500 points for JamesBurger's comment #a39889945
Assisted answer: 0 points for eli411's comment #a39890326

for the following reason:

Very good!
Avatar of eli411

ASKER

Found solution from other web sites!