Share via


TimeSpan.Negate Method

Returns a new TimeSpan object that has the negated (opposite) value of the current TimeSpan object.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

Syntax

public TimeSpan Negate ()

Return Value

A TimeSpan object that has the opposite (positive or negative) value of the current TimeSpan object.

Remarks

The value of the TimeSpan object returned by this method is numerically equal to the value of the current TimeSpan object, but the returned value has the opposite symbol (plus sign or minus sign).

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

TimeSpan Structure
TimeSpan Members
System Namespace