Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System Time.

Status
Not open for further replies.

kioko

Programmer
Sep 29, 2000
9
US
Hi everybody
I am developing a messaging based application that requires to record the time a message is sent. But since this system will be insalled as a client on a large network I need to use the system clock of one of the machines in the network. Does anyone out there know how this is done.

Thanx in advance
Kioko
 
Kioko,

This is only (reliably) accomplished by having the network admin set up a routine which syncronizes each 'client' system to the network on some occasion(s). Usuallly at network login and possibly at the start up of some program(s).

When this is accomplished, you may reasonably use the local clock.

MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
Here's a few ways to do it:


You can also shell out and run NET TIME and redirect the output to a file and parse the data in the file.

NET TIME > SERVERTIME.TXT

Karl Moore did a nice job on this one! Be sure to read the first page of this article and see how some companies appear to be overcharging for a simple task. Note: If you're behind a firewall when you try to run his code, you may not get a response if the port is not open on the firewall.

Snaggs
tribesaddict@swbell.net
If a parsley farmer is sued, can they garnish his wages?
 
net time /myserver /set /yes
will set the time of your PC to this from the server.
You can then simply ask for the system time with "now()"

call up a dosbox and type "net time /?" for more info
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top