Hello world.

直接上代码:

            int i = System.Globalization.CultureInfo.CurrentCulture.Calendar.GetWeekOfYear
                (DateTime.Now, System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Monday);
            int year = DateTime.Now.Year * 100;
            int yearweek = year + i;

 

GetWeekOfYear第一个参数:时间,

第二个参数:计划规则,如每年的第一天算不算第一周之类的,具体MSDN

第三个参数:一周的第一天,我国是:周一,国外是:周日...

 

留着总会用到的...

 

 

 

RYAN 2011年2月18日10:04:12

posted on 2011-02-18 10:04  Ryan.zhu  阅读(439)  评论(0编辑  收藏  举报
come soon on