//If the specified date is the last day of the year, GetWeekOfYear returns the total number of weeks in that year.
using System;
using System.Globalization;
public class SamplesCalendar {
public static void Main() {
CultureInfo myCI = new CultureInfo("en-US");
Calendar myCal = myCI.Calendar;
CalendarWeekRule myCWR = myCI.DateTimeFormat.CalendarWeekRule;
DayOfWeek myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;
Console.WriteLine( "The CalendarWeekRule used for the en-US culture is {0}.", myCWR );
Console.WriteLine( "The FirstDayOfWeek used for the en-US culture is {0}.", myFirstDOW );
Console.WriteLine(myCal.GetWeekOfYear( DateTime.Now, myCWR, myFirstDOW ));
DateTime LastDay = new System.DateTime( DateTime.Now.Year, 12, 31 );
Console.WriteLine( "There are {0} weeks in the current year ({1}).", myCal.GetWeekOfYear( LastDay, myCWR, myFirstDOW ), LastDay.Year );
}
}