I am using this code and this private type to bring back the current time, but I want it to show whether it is AM or PM also, though I forget what I would name the parameter. Public Declare Sub GetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME) Public 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 wAM As Integer End Type Public Sub DisplayClock(frm As Form) Dim MyTime As SYSTEMTIME frm.AutoRedraw = True GetLocalTime MyTime Dim wSecond, wMinute As Integer wSecond = MyTime.wSecond wMinute = MyTime.wMinute If Len(wSecond) = 1 Then wSecond = "0" & wSecond End If If Len(wMinute) = 1 Then wMinute = "0" & wMinute End If MyForm.n_Clock.Caption = MyTime.wHour & ":" & wMinute & ":" & wSecond & " " & MyTime.wAM End Sub
-kwandobe
|