本文整理匯總了VB.NET中System.DateTime.Millisecond屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET DateTime.Millisecond屬性的具體用法?VB.NET DateTime.Millisecond怎麽用?VB.NET DateTime.Millisecond使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.DateTime
的用法示例。
在下文中一共展示了DateTime.Millisecond屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1:
Dim moment As New System.DateTime(1999, 1, 13, 3, 57, 32, 11)
' Year gets 1999.
Dim year As Integer = moment.Year
' Month gets 1 (January).
Dim month As Integer = moment.Month
' Day gets 13.
Dim day As Integer = moment.Day
' Hour gets 3.
Dim hour As Integer = moment.Hour
' Minute gets 57.
Dim minute As Integer = moment.Minute
' Second gets 32.
Dim second As Integer = moment.Second
' Millisecond gets 11.
Dim millisecond As Integer = moment.Millisecond
示例2: Date
Dim date1 As Date = New Date(2008, 1, 1, 0, 30, 45, 125)
Console.WriteLine("Milliseconds: {0:fff}", _
date1) ' displays Milliseconds: 125
示例3: Date
Dim date3 As New Date(2008, 1, 1, 0, 30, 45, 125)
Console.WriteLine("Date with milliseconds: {0:MM/dd/yyy HH:mm:ss.fff}", _
date3)
輸出:
Date with milliseconds: 01/01/2008 00:30:45.125