Friday, 03 November, 2000

Setting the Linux System Clock

I'm no dummy, but when it comes to doing even the simplest thing on my Linux box I sometimes feel really stupid.

The switch from Daylight Savings Time happened last Saturday, and I just assumed (yes, I know how to parse that particular word) that my Linux system would automagically update the clock.  No such luck.  Today that one hour difference finally bothered me enough that I decided to reset the clock.

What a nightmare.  My first mistake was trying to find a pointy-clicky interface to set the time.  I won't bore you with all of the details.  Suffice it to say that I spent an hour finding date (what a horribly over-engineered program) and hwclock, and trying to figure out why the date command didn't update the hardware clock, and why hwclock wouldn't update the current time.

If you need to set your clock, try these two commands:

hwclock --set  --date="11/03/2000 20:05:10"
hwclock --hctosys

The first command sets the hardware clock, and the second sets the system time from the hardware clock.  There are other ways to do this (there seems to be an infinite number of ways to do things in Linux), but this is the easiest for me to remember.

An hour to set the freaking clock?!?! 

I tried searching the Internet for information on setting the date, and mostly came up with nothing new.  The Tucows hwclock man page at http://howto.tucows.com/man/man8/hwclock.8.html provides the same example as the man page on my system, but doesn't quote the date string.  The Linux FAQ at http://206.99.51.130/u/gux/linux-faq.html doesn't even mention the hwclock command.  After the ordeal (to borrow a line from Arlo Guthrie), a search of Linux.com found this article at apcmag.com, which discusses clocks in some detail and even showed me where I went wrong with the date command.

The lesson I learned from this?  Linux documentation and usability is a long way from being friendly enough for the average user.  An hour to learn how to set the clock?  Say all the bad things you want about Windows, but any first-time user could figure out how to set the clock in about 5 seconds without having to read any documentation.  Better yet, Windows understands Daylight Savings Time and automatically adjusts the clock for me.