Adds the specified TimeSpan to the current instance.
- ts
- A TimeSpan instance to add to the current instance.
A TimeSpan that represents the value of the current 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.
Documentation for this section has not yet been entered.
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
ts.Add(ts) = 00:07:09.4967294
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0