|
|
|
If you're working with VB built-in date/time functions, you can use VB Format function to convert Date/Time to any format you need. But API functions often return time in milliseconds. See how to convert it in readable format: |
Click here to copy the following block | Private Declare Function StrFromTimeInterval Lib "shlwapi" Alias "StrFromTimeIntervalA" (ByVal pszOut As String, ByVal cchMax As Long, ByVal dwTimeMS As Long, ByVal dwDigits As Long) As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Function GetFormattedTime(ByVal lTime As Long, Optional lDigits As Long = 4) As String Dim StrOut As String StrOut = Space(64) Call StrFromTimeInterval(StrOut, Len(StrOut) - 1, lTime, lDigits) GetFormattedTime = Trim(StrOut) End Function
Private Sub Form_Load() MsgBox "Your computer works " & GetFormattedTime(GetTickCount, 6) End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|