CrAzY hOuSe
Locos por la programación
Obtener la hora del Sistema (milisegundos incluidos)
.net

Syndication

Con esta función API puedes recuperar la hora actual, incluidos los milisegundos.

 

Option Explicit On
Private Declare Sub GetSystemTime Lib "kernel32" (ByVal lpSystemTime As SYSTEMTIME)
Private Type SYSTEMTIME
    wYear As Integer
    wMonth As Integer
    wDayOfWeek As Integer
    wDay As Integer
    wHour As Integer
    wMinute As Integer
    wSecond As Integer
    wMilliseconds As Integer
End Type
Private Sub Form_Load()
    Dim SysTime As SYSTEMTIME
    Dim TxtTmp As String

    ' Obtenemos la información del Sistema
    GetSystemTime(SysTime)
    TxtTmp = "Muestra la Fecha y Hora del Sistema" & vbCrLf & vbCrLf
    TxtTmp = TxTTmp & "Fecha: " & SysTime.wDay & "/" & SysTime.wMonth & "/" & SysTime.wYear & vbCrLf
    TxtTmp = TxtTmp & "Hora: " & SysTime.wHour & ":" & SysTime.wMinute & ":" & SysTime.wSecond & ":" & SysTime.wMilliseconds

    ' Mostramos la información. 
    MsgBox(TxtTmp)
End Sub

Posted lun, jul 1 2002 0:19 by Maverick
Filed under: ,

Comments

Oscar wrote re: Obtener la hora del Sistema (milisegundos incluidos)
on jue, sep 17 2009 15:52

He probado este ejemplo para recuperar los milesegundos.

He copiado exactamente como está el ejemplo.

Lo probé en Visual Basic 6, anda aca?

Cuando lo ejecuto me da este error

No se puede pasar un tipo definido por el usuario como ByVal

Como lo soluciono?

Add a Comment

(optional)  
(optional)
(required)  
Remember Me?
MavericK
Powered by Community Server (Non-Commercial Edition), by Telligent Systems