摘要: DateTime dt = DateTime.Now; //当前时间 DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))); //本周周一 DateTime endWeek = startWeek.AddDays(6); //本周周日 DateTime startMonth = dt.AddDays(1 - dt.Day); //本月月初 DateTime endMonth = startMonth.AddMonths(1).AddDays(-1); //本月月末 //DateTime endMonth = startMonth.AddDays((dt.AddMonths(1) - dt).Days - 1); //本月月末 DateTime startQuarter = dt.AddMonths(0 - (dt.Month - 1 阅读全文
posted @ 2012-12-12 15:30 蔡剑锋 阅读(23401) 评论(2) 推荐(7) 编辑