lospilotos
asked on
GetSystemTime returns zero hours, minute, second and millisecond
Hi!
Trying to get the system time using the Windows API GetSystemTime. It runs but returns zero for hour, minute, second and millisecond.
Using VB.NET in Visual Studio 2010 on a Windows 7 x86 machine.
Code below:
>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>
Public Class clsSocket
Private Declare Sub GetSystemTime Lib "kernel32" (ByRef lpSystemTime As SYSTEMTIME)
Private Structure SYSTEMTIME
Public wYear As Integer
Public wMonth As Integer
Public wDayOfWeek As Integer
Public wDay As Integer
Public wHour As Integer
Public wMinute As Integer
Public wSecond As Integer
Public wMilliseconds As Integer
End Structure
Public Sub CheckTime()
Dim StartTime As SYSTEMTIME
Dim EndTime As SYSTEMTIME
GetSystemTime(StartTime)
System.Diagnostics.Debug.W riteLine(" Start: " & StartTime.wSecond & "." & StartTime.wMilliseconds & " End: " & EndTime.wSecond & "." & EndTime.wMilliseconds)
End Sub
>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>
Any ideas?
Thanks in advance!
/Lospilotos
Trying to get the system time using the Windows API GetSystemTime. It runs but returns zero for hour, minute, second and millisecond.
Using VB.NET in Visual Studio 2010 on a Windows 7 x86 machine.
Code below:
>>>>>>>>>>>>>>>>>>>>>>>>>>
Public Class clsSocket
Private Declare Sub GetSystemTime Lib "kernel32" (ByRef lpSystemTime As SYSTEMTIME)
Private Structure SYSTEMTIME
Public wYear As Integer
Public wMonth As Integer
Public wDayOfWeek As Integer
Public wDay As Integer
Public wHour As Integer
Public wMinute As Integer
Public wSecond As Integer
Public wMilliseconds As Integer
End Structure
Public Sub CheckTime()
Dim StartTime As SYSTEMTIME
Dim EndTime As SYSTEMTIME
GetSystemTime(StartTime)
System.Diagnostics.Debug.W
End Sub
>>>>>>>>>>>>>>>>>>>>>>>>>>
Any ideas?
Thanks in advance!
/Lospilotos
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER