TimeSpan.TotalHours Property

 

Gets the value of the current TimeSpan structure expressed in whole and fractional hours.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

member TotalHours : float with get

Property Value

Type: System.Double

The total number of hours represented by this instance.

This property converts the value of this instance from ticks to hours. This number might include whole and fractional hours.

The TotalHours property represents whole and fractional hours, whereas the Hours property represents whole hours.

The following example instantiates a TimeSpan object and displays the value its TotalHours property. It also displays the value of each component (hours, minutes, seconds, and milliseconds) that forms the fractional part of the value of its TotalHours property.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: