Turns out that I have an older Dell Dimension 8400 that's just been sitting in a closet turned off for, oh, two weeks or so; it's running Slackware 13.37 with all patches applied. The hardware clock is set to UTC. I just turned it on and, yup, it's the right time:
Code:
date
Wed Nov 7 08:43:58 EST 2012
So, yes, it did adjust itself at boot and, because it runs NTP, it sync up with external time sources:
Code:
ntpq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
127.127.1.0 .LOCL. 10 l 805 64 0 0.000 0.000 0.000
*69.50.219.51 209.51.161.238 2 u 9 64 377 1191.31 1349.18 60.099
+208.53.158.34 204.9.54.119 2 u 11 64 377 879.435 1063.19 303.372
+199.241.31.96 164.244.221.197 2 u 13 64 377 992.040 1129.18 202.910
There are two things I can think of that may have led to your problem. One, if you dual-boot any version of Windows (as suggested above by @ljb643), Windows rolled the clock one hour on you -- Windows sets the hardware clock. The other is that the patches haven't been applied and that caused a problem.
If you are dual-booting Windows you can stop this behavior by booting it, click
Control Panel, click
Date and Time, click
Time Zone and remove the check mark from
Automatically Adjust for Daylight Time (this assumes
XP, the same thing is doable in
Vista or
Win 7 in slightly different ways).
On the other hand, if you're not dual-booting, you can simply set the hardware clock to UTC using, say,
http://www.time.gov/timezone.cgi?UTC/s/0, select
UTC at the lower right of the green map display then
Code:
su - (or sudo or log in as root)
# See what your hardware clock time is
hwclock
Wed 07 Nov 2012 09:36:28 AM EST -0.813113 seconds
The time shown is always local time even if you keep your hardware clock in UTC.
Now, to set the hardware clock to UTC, just look at the UTC displayed time at NIST and round it up to the next 30 second or minute (to give you enough time to type the thing, eh?), UTC right now is 14:32:21 so I'll round to the next mintute
Code:
hwclock --set --utc --date="11/07/2012 14:33:00"
But don't hit the enter key until NIST rolls around to the minute. That will get your hardware clock set to UTC which never switches to what I like to think of as "stupid time."
Then you need to worry about system time.
Bear in mind that there is only one actual clock (the hardware clock) and system time is software (it's a clock in the kernel driven by a timer interrupt). At boot, the software looks at the hardware clock and gets set to whatever your local time zone is (in the eastern time zone in the US, that's five hours earlier than UTC when not on daylight time).
You can run
timeconfig. Indicate that your hardware clock is set to UTC and select your time zone (eastern, central, etc.), reboot the thing and it should display the correct local time for you.
You've indicated that you shut the computer off at night so setting your hardware clock to UTC is a really good idea so that when daylight time rolls around twice a year you won't have the one hour glitch; the time zone stuff will work properly setting your system time for daylight or not daylight when you boot it in the morning.
It's also a good idea to set up NTP so that when you shut the system down the system time (which is what NTP keeps correct) is saved to the hardware clock -- that's part of the shutdown sequence, that saving system time to the hardware clock. They both drift and NTP is the best way to keep them on time. If you don't have an "always on" internet connection you want to manually start NTPD running after you've connected to the internet, say
Code:
su - (or sudo or log in as root)
sh /etc/rc.d/rc.ntpd start
<wait about five minutes>
nptq -pn
remote refid st t when poll reach delay offset jitter
==============================================================================
127.127.1.0 .LOCL. 10 l 86m 64 0 0.000 0.000 0.000
+69.50.219.51 209.51.161.238 2 u 90 128 377 1431.81 -55.584 32.071
*208.53.158.34 204.9.54.119 2 u 120 128 377 1509.82 -181.12 22.081
+199.241.31.96 164.244.221.197 2 u 104 128 377 1700.70 -318.39 57.700
That display is for three pool servers where
/etc/ntp.conf has these entries in the
server section near the top of the file:
Code:
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
#server pool.ntp.org
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
Those work and you don't need to fiddle with anything else in
/etc/ntp.conf to get it going, just edit the default file included with Slackware (but fiddle with it when NTPD is not running, eh?). You do want the local clock lines there so that when the internet is not available NTPD can sync to itself until the internet does become available.
Give this stuff a try and see.
Hope this helps some.