private static int GetWeekOfYear(DateTime dt)
{
GregorianCalendar gc = new GregorianCalendar();
int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay/*设置第一天*/, DayOfWeek.Monday/*设置周一为一周的第一天*/);
return weekOfYear;
}
2024-03-08 19:05:34
private static int GetWeekOfYear(DateTime dt)
{
GregorianCalendar gc = new GregorianCalendar();
int weekOfYear = gc.GetWeekOfYear(dt, CalendarWeekRule.FirstDay/*设置第一天*/, DayOfWeek.Monday/*设置周一为一周的第一天*/);
return weekOfYear;
}