TimeSpan.Add Method (TimeSpan)
.NET Framework (current version)
Returns a new TimeSpan object whose value is the sum of the specified TimeSpan object and this instance.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- ts
-
Type:
System.TimeSpan
The time interval to add.
Return Value
Type: System.TimeSpanA new object that represents the value of this instance plus the value of ts.
| Exception | Condition |
|---|---|
| OverflowException | The resulting TimeSpan 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.
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
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
Show: