You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
381 B

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