本文整理匯總了VB.NET中System.TimeSpan.TotalHours屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET TimeSpan.TotalHours屬性的具體用法?VB.NET TimeSpan.TotalHours怎麽用?VB.NET TimeSpan.TotalHours使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.TimeSpan
的用法示例。
在下文中一共展示了TimeSpan.TotalHours屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Example
Module Example
Public Sub Main()
' Define an interval of 1 day, 15+ hours.
Dim interval As New TimeSpan(1, 15, 42, 45, 750)
Console.WriteLine("Value of TimeSpan: {0}", interval)
Console.WriteLine("{0:N5} hours, as follows:", interval.TotalHours)
Console.WriteLine(" Hours: {0,3}", _
interval.Days * 24 + interval.Hours)
Console.WriteLine(" Minutes: {0,3}", interval.Minutes)
Console.WriteLine(" Seconds: {0,3}", interval.Seconds)
Console.WriteLine(" Milliseconds: {0,3}", interval.Milliseconds)
End Sub
End Module
輸出:
Value of TimeSpan: 1.15:42:45.7500000 39.71271 hours, as follows: Hours: 39 Minutes: 42 Seconds: 45 Milliseconds: 750