Make sure you make use of the NetRemoteTOD API function. I have given the code for you just make sure that you copy paste it. Enter your server name in the place of the :servername bracket given there. Do try it and run that let me know if that was of use for you or not.
Code:
DECLARE INTEGER RtlMoveMemory IN win32api ;
STRING @outbuffer, ;
INTEGER inbuffer, ;
INTEGER bytes2copy
tdbuffout=REPLICATE(CHR(0), 48)
tdbuffin = 0
server_name = "yourservername"
try_server_name = STRCONV(server_name, 5)
rc = NetRemoteTOD(@try_server_name, @tdbuffin)
IF rc = 0
* copy the contents pointed to by the address in tdbuffin to
* tdbuffout
=RtlMoveMemory(@tdbuffout, tdbuffin, 48)
ELSE
* call failed. Therefore, the target is possibly a Win2000 box;
* Retry the function call, prepending "\\" to the server_name
try_server_name = STRCONV("\\" + server_name, 5)
rc = NetRemoteTOD(@try_server_name, @tdbuffin)
IF rc = 0
=RtlMoveMemory(@tdbuffout, tdbuffin, 48)
ELSE
? "NetRemoteTOD() call failed. Return code is: ", rc
RETURN
ENDIF
ENDIF
tod_month = str2long(SUBSTR(tdbuffout, 37, 4))
tod_day = str2long(SUBSTR(tdbuffout, 33, 4))
tod_year = str2long(SUBSTR(tdbuffout, 41, 4))
tod_hours = str2long(SUBSTR(tdbuffout, 9, 4))
tod_mins = str2long(SUBSTR(tdbuffout, 13, 4))
tod_secs = str2long(SUBSTR(tdbuffout, 17, 4))
tod_timezone = str2long(SUBSTR(tdbuffout, 25, 4)) * 60
serverdatetime = DATETIME(tod_year, tod_month, tod_day, ;
tod_hours, tod_mins, tod_secs)
? "UTC time of server is: ", serverdatetime
? "Server's local time is: ", serverdatetime - tod_timezone
PARAMETERS m.longstr
PRIVATE i, m.retval
m.retval = 0
FOR i = 0 TO 24 STEP 8
m.retval = m.retval + (ASC(m.longstr) * (2^i))
m.longstr = RIGHT(m.longstr, LEN(m.longstr) - 1)
NEXT
RETURN m.retval
Bookmarks