方法一
private int WeekOfYear(string date)
{
DateTime curDay = ConvertToDateTime(date);
int firstdayofweek = ConvertToInt(ConvertToDateTime(curDayYearToString() + + )DayOfWeek);
int days = curDayDayOfYear;
int daysOutOneWeek = days ( firstdayofweek);
if (daysOutOneWeek <= )
{
return ;
}
else
{
int weeks = daysOutOneWeek / ;
if (daysOutOneWeek % != )
weeks ++;
return weeks + ;
}
}
方法二
SystemGlobalizationGregorianCalendar gc = new SystemGlobalizationGregorianCalendar();
int weekOfYear = gcGetWeekOfYear(DateTimeNow SystemGlobalizationCalendarWeekRuleFirstDay DayOfWeekMonday);