WeekOfYearISO8601
Gets the number of the week according to the definition of the ISO 8601
Source
public static int WeekOfYearISO8601(this DateTime date)
{
var day = (int)CultureInfo.CurrentCulture.Calendar.GetDayOfWeek(date);
var week = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(date.AddDays(4 - (day == 0 ? 7 : day)), CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
return week;
}
Example
int weekNumber = DateTime.Now.WeekOfYearISO8601();