This method return the integer weeknumber of a specific date.
public static int GetWeekNumber(DateTime date) {
// Gets the Calendar instance associated with a CultureInfo. CultureInfo myCI = new CultureInfo("nl-NL");
Calendar myCal = myCI.Calendar;
// Gets the DTFI properties required by GetWeekOfYear. CalendarWeekRule myCWR = myCI.DateTimeFormat.CalendarWeekRule;
DayOfWeek myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;
return myCal.GetWeekOfYear(date, myCWR, myFirstDOW);
}
More info: http://msdn.microsoft.com/en-us/library/system.globalization.calendar.getweekofyear.aspx