c# how to compare 2 dates without time

C#
if(dateTime1.Date == dateTime2.Date)
  // or 
if (dateTime1.Date.CompareTo(dateTime2.Date))
{
}
Source

Also in C#: