Debug.WriteLine("7" + Format(Now, "yyyy-MM-dd HH:mm:ss.fff").ToString)
出处:
http://hi.baidu.com/qz623/blog/item/726a2b1172199c0e5baf537d.html
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = TextBox1.Text & DateTime.Now & " " & DateTime.Now.Millisecond & Chr(13) & Chr(10)
End Sub
End Class
运行结果:
标准格式:2010-06-17 22:00:18.781(小数点后面绿色的三位数是毫秒)
Format(Now, "yyyy-MM-dd HH:mm:ss.fff")
Dim dateValue As New Date(2008, 7, 16, 8, 32, 45, 180)
outputBlock.Text &= dateValue.ToString("fff") & vbCrLf
outputBlock.Text &= dateValue.ToString("FFF") & vbCrLf
' The example displays the following output:
' 180(小f没有忽略零)
' 18 (大f忽略零)