现在的位置: 首页 > 综合 > 正文

计算本月底是几号

2011年06月07日 ⁄ 综合 ⁄ 共 313字 ⁄ 字号 评论关闭
DateTime d1 = DateTime.Now;
DateTime d2 
= d1.AddMonths(1);
System.TimeSpan s 
= d2-d1;   
//这个月月底是 s.Days.ToString;

同理,计算下个月月底是几号:

DateTime d1 = DateTime.Now;
d1 
= d1.AddMonths(1);
DateTime d2 
= DateTime.Now.AddMonths(2);
TimeSpan s 
= d2-d1;   
//下个月月底是 s.Days.ToString;

from: http://blog.toohi.com/toohi/articles/CSharp.html

【上篇】
【下篇】

抱歉!评论已关闭.