System-wide Time() function
System-wide Time() function
Is there a way to use the time() function to reset the time on all stations to the server's time? Or is there a way to use the time() from the server rather than from the station running the exe file?
-
- Posts: 484
- Joined: Wed Jan 27, 2010 10:25 pm
- Location: Berlin Germany
Re: System-wide Time() function
Perhaps you can set the time of the computer with
Code: Select all
net time /SET
_______________________
Best Regards
Wolfgang
Best Regards
Wolfgang
Re: System-wide Time() function
Thanks. This certainly works. I was wondering if there was an Express command or a way in Xbase to build this into the *.exe file.
Re: System-wide Time() function
If there is an Xbase function, it should propably be in the xbtools. I didn't check, but there are some network functions in it.GeneB wrote:I was wondering if there was an Express command or a way in Xbase to build this into the *.exe file.
Re: System-wide Time() function
XbTools Network Function XbtNetW.LIB need Novel Client like NnetSTime() and does not work with M$ Lanmanager.skiman wrote:If there is an Xbase function, it should propably be in the xbtools. I didn't check, but there are some network functions in it.
only some NetBIOS functions of XBTNETB.LIB can be used in M$ Network
greetings by OHR
Jimmy
Jimmy
Re: System-wide Time() function
I came up with a very simple way to do this: create a file on the server, extract its time and date, erase the file.
The file created has the server's time/date, and the station uses that to time stamp its document. It is far less likely that a user will accidentally change the server's time and date, as they occassionally do to the stations. This is very important in our retail situation for sales receipts, cash balancing, sales reports, etc.
-=#GeneB
The file created has the server's time/date, and the station uses that to time stamp its document. It is far less likely that a user will accidentally change the server's time and date, as they occassionally do to the stations. This is very important in our retail situation for sales receipts, cash balancing, sales reports, etc.
-=#GeneB
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}