TimeSpan.UnaryNegation Operator (TimeSpan)

 
equivalentCodeEntityM:System.TimeSpan.Negate

Returns a TimeSpan whose value is the negated value of the specified instance.

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

static let inline (-)
        t:TimeSpan : TimeSpan

Parameters

t
Type: System.TimeSpan

The time interval to be negated.

Return Value

Type: System.TimeSpan

An object that has the same numeric value as this instance, but the opposite sign.

Exception Condition
OverflowException

The negated value of this instance cannot be represented by a TimeSpan; that is, the value of this instance is TimeSpan.MinValue.

The following example applies the UnaryNegation operator to several TimeSpan objects.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: