Returns a TimeSpan whose value is the absolute value of the current instance.
A TimeSpan whose value is the absolute value of the current instance.
Type Reason OverflowException The value of the current instance is TimeSpan.MinValue.
Documentation for this section has not yet been entered.
The following example demonstrates the TimeSpan.Duration method.
C# Example
using System; public class TimeSpanDurationExample { public static void Main() { TimeSpan ts = new TimeSpan(Int32.MinValue); Console.Write("The absolute value of TimeSpan {0} ", ts); Console.WriteLine("is {0}", ts.Duration()); } }The output is
The absolute value of TimeSpan -00:03:34.7483648 is 00:03:34.7483648
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0