Returns a new TimeSpan object whose value is the sum of the specified TimeSpan object and this instance.
A new object that represents the value of this instance plus the value of ts.
Type Reason OverflowException The sum of the value of the current instance and the value of ts is less than TimeSpan.MinValue or greater than TimeSpan.MaxValue.
The return value must be between TimeSpan.MinValue and TimeSpan.MaxValue; otherwise, an exception is thrown.
The return value is a new TimeSpan; the original TimeSpan is not modified.
This example demonstrates the TimeSpan.Add(TimeSpan) method.
C# Example
using System; public class TimeSpanAddExample { public static void Main() { TimeSpan ts = new TimeSpan(Int32.MaxValue); Console.WriteLine("The value of the timespan 'ts' is {0}", ts); Console.WriteLine("ts.Add(ts) = {0}", ts.Add(ts)); } }
The output is
The value of the timespan 'ts' is 00:03:34.7483647