Click or drag to resize
TimeSpanFromHours Method
Returns a TimeSpan that represents a specified number of hours, where the specification is accurate to the nearest millisecond.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static TimeSpan FromHours(
	double value
)

Parameters

value
Type: SystemDouble
A number of hours accurate to the nearest millisecond.

Return Value

Type: TimeSpan
An object that represents value.
Exceptions
ExceptionCondition
OverflowExceptionvalue is less than MinValue or greater than MaxValue. -or-value is PositiveInfinity.-or-value is NegativeInfinity.
ArgumentExceptionvalue is equal to NaN.
See Also