新建From1(窗体),新建Command1(按钮CommandButton),代码:
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 Declare Sub GetSystemTime Lib "kernel32.dll" (lpSystemTime As SYSTEMTIME)
Dim gtime As SYSTEMTIME
'Task: Get Current Greewich Mean Time using GetSystemTime API
Private Sub Command1_Click()
GetSystemTime gtime
MsgBox "Time in Greewich is " & gtime.wHour & ":" & gtime.wMinute & ":" & gtime.wSecond
End Sub