引用:

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"));

posted on 2012-02-01 11:14  Yang-S  阅读(3596)  评论(0)    收藏  举报