private static int GetWeekOfYear(DateTime dt)
{
GregorianCalendar gc = new GregorianCalendar();
int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay/*设置第一天*/, DayOfWeek.Monday/*设置周一为一周的第一天*/);
return weekOfYear;
}
private static int GetWeekOfYear(DateTime dt)
{
GregorianCalendar gc = new GregorianCalendar();
int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay/*设置第一天*/, DayOfWeek.Monday/*设置周一为一周的第一天*/);
return weekOfYear;
}
转载于:https://www.cnblogs.com/yesicoo/p/4718776.html