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; } }