Today I needed to know which week of the year a certain day was in. My first instinct was DateTime.Now.Weekbut it seems there is no Week property on a DateTime instance. So I started looking for a way to get the week number. As it turns out the CultureInfo class will get you where you want to go using the Calendar property.

public static class DateTimeExtensions
{
    public static int WeekNumber(this System.DateTime value)
    {
        return CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(value, CalendarWeekRule.FirstFourDayWeek,
                                                                 DayOfWeek.Monday);
 
    }
}