Partager via


TimeSpan.Hours Property

Gets the number of whole hours in the current TimeSpan object (time period).

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

Syntax

public int Hours { get; }

Property Value

The number of whole hours in the current TimeSpan object.

Remarks

The value of a TimeSpan object can be expressed as [-]d.hh:mm:ss.ff, where the optional minus sign indicates a negative time period, d is days, hh is hours as measured on a 24-hour clock, mm is minutes, ss is seconds, and ff is fractions of a second. The value of the Hours property is the hour component, hh.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

TimeSpan Structure
TimeSpan Members
System Namespace