C# 获取当前周WeekOfYear的方法

static   int  GetWeekOfYear()
        {
            CultureInfo ci 
=   new  CultureInfo( " zh-CN " );
            System.Globalization.Calendar cal 
=  ci.Calendar;
            CalendarWeekRule cwr 
=  ci.DateTimeFormat.CalendarWeekRule;
            DayOfWeek dow 
=  DayOfWeek.Monday;
            
int  week  =  cal.GetWeekOfYear(DateTime.Now, cwr, dow);
            
return  week;
        }

转载于:https://www.cnblogs.com/dflower/archive/2009/04/15/1436453.html

你可能感兴趣的:(C# 获取当前周WeekOfYear的方法)