By default C# compares DateTime objects to the 100ns tick. However, my database returns DateTime values to the nearest millisecond. What\'s the best way to compare two DateT
You need to remove the milliseconds component from the date object. One way is:
DateTime d = DateTime.Now;
d.Subtract(new TimeSpan(0, 0, 0, 0, d.Millisecond));
You can also subtract two datetimes
d.Subtract(DateTime.Now);
This will return a timespan object which you can use to compare the days, hours, minutes and seconds components to see the difference.