This following script allows to easily set time of your Linux box:
(wget -S --spider
--server-response http://www.time.gov) 2> .response
grep Date .response | tail -n 1 | sed -e 's/^.*Date: //g' | sed -e 's/ /\\ /g' | xargs date -s
This is not the recommended way, this is an alternative one, using HTTP response headers to get date.
It is better to get your time from NTP servers, see http://www.ntp.org.
Once you have installed the ntp package, there is a ntp-client (script) you can start each time you boot
this is equivalent to run:
ntpdate -u pool.ntp.org
if you want to find the closest mirror:
netselect -s 3 pool.ntp.org
and use the first ip in the result to replace pool.ntp.org in the configuration of your ntp-client .
If you use Gentoo distro, you will find the setting in /etc/conf.d/ntp-client.
and you can add the ntp-client to the boot sequence, just doing:
rc-update add ntp-client default
Having time service working under Windows 2K is very easy: (see also here)
net time /setsntp:pool.ntp.org
net start w32time
To make the time service start at startup:
Start/Parameters/Control Panel then Administrative Tools/Services
Look for Windows Clock service, and change manual start to automatic start.
validate me (XHTML 1.0 Strict)
ZOurtON.org by Denis Etienne (gmail)- april 2005 - size: 2483