DateTime dt = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00");
                //获得本月月初时间
                var startMonth = dt.AddDays(1 - dt.Day);
                //获得本月月末时间
                DateTime s = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59");
                DateTime ss = s.AddDays(1 - s.Day);
                var endMonth = ss.AddMonths(1).AddDays(-1);

 

posted on 2015-12-07 17:06  嘟嘟熊的麦  阅读(4128)  评论(0编辑  收藏  举报