There is a thread at the Liberty BASIC Community Forum asking how to get the current UTC time. This is quite straightforward using the Windows API, but for some reason nobody seems to have posted the code to do it. Instead various complicated or non-working solutions have been offered.
For the record, here is a simple example of how to print the UTC time in LB or LBB:
Code: struct st, wYear as word, wMonth as word, wDayOfWeek as word, _
wDay as word, wHour as word, wMinute as word, wSecond as word, _
wMilliseconds as word
calldll #kernel32, "GetSystemTime", st as struct, ret as long
print "The current time (UTC) is "; dig2$(st.wHour.struct); ":"; _
dig2$(st.wMinute.struct); ":"; dig2$(st.wSecond.struct)
end
function dig2$(n)
dig2$ = right$("0" + str$(n), 2)
end function
Richard.