DateTimeUtil.Add(DateTime, TimeSpan) Method

Definition

Adds a DateTime and a TimeSpan. If the resulting value exceeds MaxValue, returns MaxValue. If the resulting value is less than MinValue, returns MinValue.

public static DateTime Add (DateTime time, TimeSpan timespan);
static member Add : DateTime * TimeSpan -> DateTime
Public Shared Function Add (time As DateTime, timespan As TimeSpan) As DateTime

Parameters

time
DateTime

Initial DateTime value.

timespan
TimeSpan

TimeSpan to add.

Returns

The sum of time and timespan, or MaxValue if the sum exceeds it, or MinValue if the sum is less than it.

Applies to