System.DateTime.op_Addition Method

Adds a specified time interval to a specified date and time, yielding a new date and time.

Syntax

public static DateTime operator+ (DateTime d, TimeSpan t)

See Also

DateTime.Add(TimeSpan)

Parameters

d
The date and time value to add.
t
The time interval to add.

Returns

An object that is the sum of the values of d and t.

Exceptions

TypeReason
ArgumentOutOfRangeExceptionThe resulting date and time is less than DateTime.MinValue or greater than DateTime.MaxValue.

Remarks

The returned value is equivalent to DateTime( d.Ticks + t.Ticks ).

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0