//获取本周一天和最后一天,周一为第一天
//DateTime now = DateTime.Now;//输入日期
//int today = (int)now.DayOfWeek;
//Console.WriteLine("本周开始日期{0:d},结束日期{1:d}", now.AddDays(-today+1), now.AddDays(7 - today));
//Console.WriteLine("上周开始日期{0:d},结束日期{1:d}", now.AddDays(-today - 6), now.AddDays(-today));
//获取本月第一天和最后一天
//DateTime time = DateTime.Now;
////天
//Console.WriteLine(time.Day);
////当月第一天
//Console.WriteLine(time.AddDays(1 - time.Day));
////当月最后一天
//Console.WriteLine(time.AddDays(1 - time.Day).AddMonths(1).AddDays(-1));
////下月第一天
//Console.WriteLine(time.AddDays(1 - time.Day).AddMonths(1));
////下月最后一天
//Console.WriteLine(time.AddDays(1 - time.Day).AddMonths(2).AddDays(-1));
//获取本季度第一天和最后一天
//DateTime dt = DateTime.Now;
//DateTime starttime = dt.AddMonths(0 - (dt.Month - 1) % 3).AddDays(1 - dt.Day);
//Console.WriteLine(starttime);
//DateTime endtime = starttime.AddMonths(3).AddDays(-1);
//Console.WriteLine(endtime);