/// <summary> /// 获取当前日期是一年中的第几周 /// </summary> /// <param name="time"></param> /// <returns></returns> public static int CurrentWeekIndex(this DateTime time) { var calendar = CultureInfo.CurrentCulture.Calendar; return calendar.GetWeekOfYear(time, CalendarWeekRule.FirstDay, DayOfWeek.Monday); }