Simplest way to calculate the number of business days left in the month?

  • Thread starter Thread starter sherifffruitfly
  • Start date Start date
S

sherifffruitfly

Hi all,

The easiest thing I can see is to use this little class:

http://www.codeproject.com/csharp/busdatescalculation.asp

And read holidays from a text file into a Hashtable.


Example of the functionality I need:

DateTime iHateValDay = DateTime.Parse("14 Feb 2007");
int daysRemaining = DaysLeft(iHateValDay);

Here, daysRemaining should be 9.


Does anyone know of a simpler way to achieve this?


Thanks for any ideas,

cdj
 
Hi all,

The easiest thing I can see is to use this little class:

http://www.codeproject.com/csharp/busdatescalculation.asp

And read holidays from a text file into a Hashtable.

Example of the functionality I need:

DateTime iHateValDay = DateTime.Parse("14 Feb 2007");
int daysRemaining = DaysLeft(iHateValDay);

Here, daysRemaining should be 9.

Does anyone know of a simpler way to achieve this?

Thanks for any ideas,

cdj

Hi,

Well, if your application happens to be database bound then the
easiest way to do this is to use a calendar table and SQL queries to
return the date calculations.

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top