Hope someone finds this useful.
GeneB in Albuquerque
Code: Select all
FUNCTION ServerTimeDate()
local cTime,dDate, nHandle, aDirectory
// requires Directry.ch
// DataPath() stores the path to the dbf files on the server
// file gets creation time and date from the server it resides on, DataPath()
FERASE( DataPath() + "\timefile.txt" )
nHandle := FCreate(DataPath() + "\timefile.txt")
// get the file's date and time
IF nHandle > 0
aDirectory := DIRECTORY ( DataPath() + "\timefile.txt" )
dDate := aDirectory[1,F_CREATION_DATE]
cTime := aDirectory[1,F_CREATION_TIME]
ELSE
dDate := DATE()
cTime := TIME()
ENDIF
FCLOSE(nHandle)
FERASE( DataPath() + "\timefile.txt" )
RETURN {cTime,dDate}