引用:
using System.Globalization;
函数:
public static int WeekOfYear(DateTime dt, CultureInfo ci)
{
return ci.Calendar.GetWeekOfYear(dt, ci.DateTimeFormat.CalendarWeekRule, ci.DateTimeFormat.FirstDayOfWeek);
}
调用:
int a=WeekOfYear(this.dateTimePicker1.Value, new CultureInfo("zh-CN"));