~~Work Week~~

knockyo

Well-known member
Joined
Sep 20, 2006
Messages
78
Programming Experience
1-3
Hi all,

how can I calculate work week using by code?

thanks for help :p
 
What about "work week" is it you want to calculate?
 
Perhaps the Date data type can help you?
 
I'm not sure what you're getting at, so I have no idea what example I should post here
VB.NET:
    Private Function IsWorkWeek(ByVal FirstDay As DateTime, ByVal SecondDay As DateTime) As Boolean
        If FirstDay.DayOfWeek = DayOfWeek.Monday AndAlso SecondDay.DayOfWeek = DayOfWeek.Friday Then
            Return True
        Else
            Return False
        End If
    End Function
 
Are you sure you dont just want the current week of the year?

VB.NET:
    Private Function WorkWeek(ByVal whatDate As Date) As Int32
        WorkWeek = DatePart(DateInterval.WeekOfYear, whatDate)
    End Function
 
Back
Top