Mono Class Library: System.DateTime Overview | Members

System.DateTime.AddSeconds Method

Adds a specified number of seconds to the value of the current instance.

public DateTime AddSeconds (double value)

Parameters

value
A double containing the number of whole and fractional seconds. For example, 4.5 is equivalent to 4 seconds, 500 milliseconds, and 0 ticks. value can be positive or negative.

Returns

A DateTime instance set to the sum of the date and time represented by the current instance and the number of seconds represented by value.

Exceptions

TypeReason
ArgumentExceptionThe resulting DateTime is less than DateTime.MinValue or greater than DateTime.MaxValue.

Remarks

Note: value is rounded to the nearest tick.

Requirements

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