Gets the number of hours represented by the current instance.
A int between 0 and 23 inclusive, that represents the hours component of the current instance.Note: See TimeSpan.ToString for a more detailed description of the hours component.
This property is read-only.
This example demonstrates using the TimeSpan.Hours property.
C# Example
using System; public class TimeSpanPropertiesExampleOne { public static void Main() { TimeSpan ts = new TimeSpan((Int64)10e12+3456789); Console.WriteLine(ts.ToString()); Console.WriteLine("Hours: {0}", ts.Hours ); } }The output is
11.13:46:40.3456789
Hours: 13
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0