Next Working Day
Public Class MainClass
Public Shared Sub Main()
Dim datNewDate As Date = AddWorkingDays(Today, 1)
System.Console.WriteLine(datNewDate)
End Sub
Public Shared Function AddWorkingDays(ByVal DateIn As Date, ByVal ShiftDate As Integer) As Date
Dim datDate As Date = DateIn.AddDays(ShiftDate)
While Weekday(datDate) = 1 Or Weekday(datDate) = 7
datDate = datDate.AddDays(IIf(ShiftDate < 0, -1, 1))
End While
Return datDate
End Function
End Class
Related examples in the same category