Discussion Locked

automatic setting of system time

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

On operating systems such as VMS and RSX it was possible for a program to receive a time signal via an RS232 port and tehn to update the system time automatically. I wish to do the same on Windows NT from a Labview application. Reading the time signal presents no problem, nor does comparing the time read with the system time.
I am aware that some programs are available that use a time signal from teh net to set teh system time but that unfortuenately is not an option. Can anyone supply teh missing information to enable me to code a module for setting the system time without operator action. If so please mail me David@alpha-comp.co.uk

10 replies

by fenaikh

Hi
you can use a batch file to set date and time in dos and win9x with the file ext bat example name timedate.bat or winnt/2k/xp with the ext timedate.cmd
the folowing example will set the date wich is suplied.

-------------------

rem Name timedate.cmd for win/nt/2k/xp
rem Name timedate.bat in dos and win9x

echo on

echo 24-4-2002 | date

echo 14:32 | time
-----------------------

rem to pass a a date and a time to it just use the the passed paramters.

echo on
echo "%1" | date
echo "%2" | time

---------------------------

note i sent you a big batch file where you see how to parse and make diffrent setting

good luck

Mohamed

by jayanth

Make sure that you have one machine on the network with the correct time.

Then on all yout workstations you can run the command "net time \\server-name /set /y" which will set the time from the machine . You may also include this line in a logon script or a batch file.

by curlergirl

If you can't set your machine directly from the Internet, is it possible to set another local machine from an Internet time server and have your machine sync it's time from that one? If so, the only additional software you need on an NT machine to set your time from an Internet time server is a program called W32time which is part of the NT Resource Kit - you can download it from the Microsoft web site (go to www.microsoft.com/technet) and look up "NT Resource Kit" or "time service". I believe there is a readme file with it that includes instructions on installing and setting it up. You can use any of several different timeservers on the Net - the only ones I know of directly are in the U.S., but I'm sure there are U.K. sites, too. Then, your local machine can be set using the same W32time program, but the settings in the .ini file would point to the local server rather than an external one. Hope this helps!

by chris hirst

Fairly comprehensive list of Internet time servers from David Mills

http://www.eecis.udel.edu/~mills/ntp/servers.htm

You need to set a server on your network to sync up to to one of the secondary servers and then set all your network clients to sync from your time server. You will need to download the latest W32Time service from MS and put the settings into the .ini file for NT 4.0 use, for win2k use the command 'net time /setsntp: to setup your primary server (the client syncis automatic), for Win9x clients you will need to add a line to the logon script of 'NET TIME \\ /Y'

Chris.

This discussion is closed to new replies.