[wplug] System time on debian

Bill Moran wmoran at potentialtech.com
Fri Jun 11 08:06:10 EDT 2004


Andreas Rindler <arindler at cmu.edu> wrote:

> Hey,
> I recently installed Debian and I somehow screwed up the system time. I 
> am in the Eastern US time zone but the system clock is 6 hours behind. 
> I.e., it should be 7 am, but the system displays 1 am.
> 
> I found the date command, but couldn't quite figure out how to change 
> the time with someting like
> current date +6

Pay close attention to the timezone announced when you request the date with
"date" ... i.e.:
Fri Jun 11 07:57:56 EDT 2004

There, you can see my timezone is set to EDT, thus is correct for me.

The point is, if your timezone is wrong, fix that before adjusting the
date/time, or you'll go nuts.

Check to see if you have ntp running:
netstat -l | grep ntp

If it is running, then you'll have to stop it before you can set the time, or
it will just reset it for you later.  If ntp is running and your time is wrong,
then you are getting the time for a seriously fscked time server.  If it's not
running, enabling it may be the easiest way to get your time corrected.  You
can start it from the command line "ntpd -g" ... the -g is required to tell
ntp that the time is _way_ off and it should correct it anyway, otherwise, ntp
assumes that the time server must be nuts and exits with an error.

Note that ntp can take a while to set the time initially, as it'll wait to see
how many time servers respond with an agreeing time and all kinds of
conservative stuff like that.  It's a nice daemon to have enabled to keep your
clock on track all the time.

Anyway, the date command is most easily used (IMHO)  by giving the full time:
date 0804
Will set the time to 8:04 AM.

-- 
Bill Moran
Potential Technologies
http://www.potentialtech.com



More information about the wplug mailing list