What\'s the easiest way to compute the amount of working days since a date? VB.NET preferred, but C# is okay.
And by \"working days\", I mean all days excluding Satu
The easiest way is probably something like
DateTime start = new DateTime(2008, 10, 3);
DateTime end = new DateTime(2008, 12, 31);
int workingDays = 0;
while( start < end ) {
if( start.DayOfWeek != DayOfWeek.Saturday
&& start.DayOfWeek != DayOfWeek.Sunday ) {
workingDays++;
}
start = start.AddDays(1);
}
It may not be the most efficient but it does allow for the easy checking of a list of holidays.