Returns the DateTime result from adding this instance to a fractional number of hours.
[Visual Basic] Public Function AddHours( _ ByVal value As Double _ ) As DateTime [C#] public DateTime AddHours( double value ); [C++] public: DateTime AddHours( double value ); [JScript] public function AddHours( value : double ) : DateTime;
The DateTime value that results from adding a fractional number of hours to this instance.
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | If the resulting DateTime is outside the supported range. |
The AddHours returns the value parameter that is computed by rounding the fractional number of hours specified by value to the nearest millisecond of the nearest integer, and then adding the interval to this instance of DateTime.
The value parameter argument is permitted to be negative.
DateTime Structure | DateTime Members | System Namespace | Double | Hour