namespace Common.Util; public class DateUtils { public static bool IsDateTimeToday(DateTime? dateTime) { if (dateTime == null) { return false; } DateTime startOfToday = DateTime.Today; DateTime endOfToday = startOfToday.AddDays(1).AddTicks(-1); return dateTime >= startOfToday && dateTime <= endOfToday; } /// 获取明天的0.0.0 public static DateTime GetTomorrowFirst() { DateTime today = DateTime.Now; // 获取当前时间 DateTime tomorrow = today.Date.AddDays(1); // 获取明天的日期 return new DateTime(tomorrow.Year, tomorrow.Month, tomorrow.Day, 0, 0, 0); // 获取明天的0点 } }