Domino Code Fragment

Code Name*
API Call to Retrive Local Time (Win95 & WinNT)
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.220.136.165
Description*
Uses the function GetLocalTime in the Kernel32.DLL to retrive Time.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Note: For Coordinated Universal Time (UTC) replace the function name GetLocalTime to GetSystemTime in the declarations and calls. The SYSTEMTIME structure represents a date and time using individual members for the month, day, year, weekday, hour, minute, second, and millisecond. Members wYear Specifies the current year. wMonth Specifies the current month; January = 1, February = 2, and so on. wDayOfWeek Specifies the current day of the week; Sunday = 0, Monday = 1, and so on. wDay Specifies the current day of the month. wHour Specifies the current hour. wMinute Specifies the current minute. wSecond Specifies the current second. wMilliseconds Specifies the current millisecond.
Files/Graphics attachments (if applicable): Code:
Example:

(Declarations)

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


Declare Function GetLocalTime Lib "kernel32.dll" Alias "GetLocalTime" (lpSystemTime As SYSTEMTIME) As Integer

Sub Click(Source As Button)
    Dim SysTime As SYSTEMTIME
    GetLocalTime SysTime
    Messagebox  SysTime.wMonth & "/" & SysTime.wDay & "/" & SysTime.wYear  &_
    "  " & SysTime.wHour & ":" & SysTime.wMinute & ":" & SysTime.wSecond, , "Date & Time"
End Sub