DateTime.Subtract Method (DateTime)
Subtracts the specified date and time from this instance.
Assembly: mscorlib (in mscorlib.dll)
If the date and time of the current instance is earlier than value, the method returns a TimeSpan object that represents a negative time span. That is, the value of all of its non-zero properties (such as Days or Ticks) is negative.
TheKind 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.method does not consider the value of the
The DateTimeOffset.Subtract(DateTimeOffset) method does consider the difference between time zones when performing the subtraction.
Available since 4.5
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1