Compares the value of this instance to a specified object that contains a specified DateTime value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified DateTime value.
A signed number indicating the relative values of this instance and value.
Less than zero This instance is earlier than value.
Zero This instance is the same as value.
Greater than zero This instance is later than value, or value is null.
Type Reason ArgumentException value is not a DateTime and is not a null reference.
Before comparing DateTime objects, make sure that the objects represent times in the same time zone. You can do this by comparing the values of their DateTime.Kind properties.
Any instance of DateTime, regardless of its value, is considered greater than null.