日期:2014-05-18  浏览次数:20424 次

ASP.NET怎样获取当前的时间的年月周
获取本机时间,来显示当月的第几周,并可以通过选择月份去联动月份周数。求解!!!!!求代码

------解决方案--------------------
http://topic.csdn.net/u/20070802/09/cd1e204d-7d98-4db3-869e-97360e01b167.html
------解决方案--------------------
参考
http://www.cnblogs.com/cnhefang/archive/2009/02/13/1390316.html
------解决方案--------------------
DateTime dt = DateTime.Now();
int year = dt.Year;
int month = dt.Month;
int week = (dt.Day - (new DateTime(year, month, 1)).DayOfWeek) / 7 + 1;
------解决方案--------------------
http://blog.sina.com.cn/s/blog_5cab17130100t4lr.html
不但告诉你获取 还告诉你 格式
------解决方案--------------------
探讨
DateTime dt = DateTime.Now();
int year = dt.Year;
int month = dt.Month;
int week = (dt.Day - (new DateTime(year, month, 1)).DayOfWeek) / 7 + 1;