TimeSpan.Duration Method ()

 

Returns a new TimeSpan object whose value is the absolute value of the current TimeSpan object.

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

member Duration : unit -> TimeSpan

Return Value

Type: System.TimeSpan

A new object whose value is the absolute value of the current TimeSpan object.

Exception Condition
OverflowException

The value of this instance is TimeSpan.MinValue.

The following example applies the Duration method 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: