03-01-2023, 02:40 PM
(This post was last modified: 03-01-2023, 02:46 PM by SpriggsySpriggs.)
One could do it with Win32 API but I don't have the code handy right now. This is a good reference if you know what you're doing. If not, I can assist.
SYSTEMTIME (minwinbase.h) - Win32 apps | Microsoft Learn
Simple conversion of the small sample at the bottom of that page:
SYSTEMTIME (minwinbase.h) - Win32 apps | Microsoft Learn
Simple conversion of the small sample at the bottom of that page:
Code: (Select All)
Option Explicit
$NoPrefix
$Console:Only
Type SYSTEMTIME
As Unsigned Integer wYear, wMonth, wDayOfWeek
As Unsigned Integer wDay, wHour, wMinute
As Unsigned Integer wSecond, wMilliseconds
End Type
Declare CustomType Library
Sub printf (format As String, Byval arg1 As Unsigned Integer, Byval arg2 As Unsigned Integer)
Sub GetSystemTime (ByVal lpSystemTime As Offset)
Sub GetLocalTime (ByVal lpSystemTime As Offset)
End Declare
Dim As SYSTEMTIME st, lt
GetSystemTime (Offset(st))
GetLocalTime (Offset(lt))
printf "The system time is: %02d:%02d" + Chr$(10) + Chr$(0), st.wHour, st.wMinute
printf " The local time is: %02d:%02d" + Chr$(10) + Chr$(0), lt.wHour, lt.wMinute
Ask me about Windows API and maybe some Linux stuff