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
This'll do what you want it to. It should be easy enough to convert to VB.NET, it's been too long for me to be able to do it though.
DateTime start = DateTime.Now;
DateTime end = start.AddDays(9);
IEnumerable holidays = new DateTime[0];
// basic data
int days = (int)(end - start).TotalDays;
int weeks = days / 7;
// check for a weekend in a partial week from start.
if (7- (days % 7) <= (int)start.DayOfWeek)
days--;
if (7- (days % 7) <= (int)start.DayOfWeek)
days--;
// lose the weekends
days -= weeks * 2;
foreach (DateTime dt in holidays)
{
if (dt > start && dt < end)
days--;
}