Problem : How do I get number of week per year.
Solution :
// Get Num Of Week Per Year
public static int Iso8601WeekNumber(DateTime dt)
{
System.Globalization.CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentCulture;
int weekNumOnMonth = ci.Calendar.GetWeekOfYear(dt, ci.DateTimeFormat.CalendarWeekRule, ci.DateTimeFormat.FirstDayOfWeek);
return weekNumOnMonth;
}
Reference:
using System.Globalization;
C# Get Week Number In Year
Posted by Unknown at 8/30/2013 11:43:00 am
Labels: ASP.net C#, C#
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment