NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DateTime Subtraction Operator (DateTime, TimeSpan)

Subtracts a specified TimeSpan from a specified DateTime, producing a new DateTime.

[C#]
public static DateTime operator -(
   DateTime d,
   TimeSpan t
);
[C++]
public: static DateTime operator op_Subtraction(
   DateTime d,
   TimeSpan t
);
[JScript]
returnValue = d - t;

[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.

Arguments [JScript]

d
A DateTime value.
t
A TimeSpan value.

Parameters [C#, C++]

d
A DateTime value.
t
A TimeSpan value.

Return Value [C#, C++, JScript]

A DateTime value with a Ticks value equal to the difference of the ticks value.

Remarks [C#, C++, JScript]

This operator subtracts a TimeSpan value from a DateTime value after converting them to ticks, and the difference is formatted as a DateTime value (d and t: d- t).

See Also

DateTime Structure | DateTime Members | System Namespace | DateTime Subtraction Operator Overload List | Ticks | TimeSpan