Subtracts a DateTime value from a DateTime value, producing a time interval (TimeSpan).
[C#] public static TimeSpan operator -( DateTime d1, DateTime d2 ); [C++] public: static TimeSpan operator op_Subtraction( DateTime d1, DateTime d2 ); [JScript] returnValue = d1 - d2;
[Visual Basic] In Visual Basic, you cannot use the operators defined by a type, nor override them or define your own.
[JScript] In JScript, you can use the operators defined by a type, but you cannot override them or define your own.
Returns a DateTime value with a Ticks value equal to the difference of the ticks value.
This operator subtracts two DateTime values, using a ticks value, and the difference is formatted as a TimeSpan value (d1 and d2: d1- d2).
DateTime Structure | DateTime Members | System Namespace | DateTime Subtraction Operator Overload List | Ticks | TimeSpan