Subtracts a specified date and time from another specified date and time and returns a time interval.
The time interval between d1 and d2; that is, d1 minus d2.
Type Reason ArgumentOutOfRangeException The resulting date and time is less than DateTime.MinValue or greater than DateTime.MaxValue.
The DateTime.op_Subtraction(DateTime, DateTime) method does not consider the value of the DateTime.Kind property of the two DateTime values when performing the subtraction. Before subtracting DateTime objects, ensure that the objects represent times in the same time zone. Otherwise, the result will include the difference between time zones.
The DateTimeOffset.op_Subtraction(DateTimeOffset, DateTimeOffset) method does consider the difference between time zones when performing the subtraction.