DateTime today = dt.Date;//今天 00:00:00
DateTime tomorrow = dt.Date.AddDays(1);//明天 00:00:00
DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOfWeek.ToString("d"))).Date; ; //本周周一
DateTime startNextWeek = startWeek.AddDays(7).Date; //下周周一
DateTime startMonth = new DateTime(dt.Year, dt.Month, 1); //本月月初
DateTime startNextMonth = new DateTime(dt.Year, dt.Month + 1, 1); //下月月初
DateTime startYear = new DateTime(dt.Year, 1, 1); //本年年初
DateTime startNextYear = new DateTime(dt.Year + 1, 1, 1); //次年年初
时间: 2024-11-06 10:08:32