Returns the DateTime object resulting from adding a fractional number of days to the specified DateTime.
[Visual Basic] Overridable Public Function AddDays( _ ByVal time As DateTime, _ ByVal days As Integer _ ) As DateTime [C#] public virtual DateTime AddDays( DateTime time, int days ); [C++] public: virtual DateTime AddDays( DateTime time, int days ); [JScript] public function AddDays( time : DateTime, days : int ) : DateTime;
The DateTime resulting from adding the specified fractional number of days to the specified DateTime.
Exception Type | Condition |
---|---|
ArgumentException | is thrown if the resulting DateTime is outside the supported range. |
The result is computed by rounding the fractional number of days specified by days to the nearest millisecond, and adding that interval to the specified DateTime. The days argument is permitted to be negative.
Calendar Class | Calendar Members | System.Globalization Namespace