1 /// <summary> 2 /// 获取指定日期,在为一年中为第几周 3 /// </summary> 4 /// <param name="dt">指定时间</param> 5 /// <reutrn>返回第几周</reutrn> 6 private static int GetWeekOfYear(DateTime dt) 7 { 8 GregorianCalendar gc = new GregorianCalendar(); 9 int weekOfYear = gc.GetWeekOfYear(dt,CalendarWeekRule.FirstDay, DayOfWeek.Monday); 10 return weekOfYear; 11 }