View Full Version : serious confusion over clock inconsistancies in Linux

29-12-2002, 09:20 AM
About 1:00am this morning i did something that i never do, i turned Sam the SuSE8 Linux box off for the first time since i moved it to a new desk some months ago. When i turned it on less than an hour ago, the time said 14:17 24 December 2002

I was sure we got passed that Xmas thingy, so i was a bit suspect about this.

Why does this happen?


Graham L
29-12-2002, 02:22 PM
The battery clock on your motherboard was wrong. :D

*nixes don't look at the hardware clock unless they are explicitly told to, or at boot time. This is because almost all pre-PC At computers didn't have hardware clocks: the operator had to enter date and time from the console at boot time. The *nix clock is a counter (of seconds since Jan 1 1970, I think) which is maintained by interrupts (on PCs, the famous 18.2 tick/sec).

You could make a up a cron task to keep the hardware clock in line with the system, but it would pay to have it make a call to a network time server first.

Use "man clock" (or "man hwclock") to see how to set/read the motherboard's clock. There is a thing to watch ... make sure that if the Linux is set to use "GMT" from the hardware that the hardware is set to that time. (This can cause problems on dualbooted systems).

29-12-2002, 02:39 PM
Thanks Graham,

Dual boot isn't a problem as this is a dedecated Linux machine, not that that may be relevant.

How do i connect and co-ordinate with a network time server, and how do i work around the GMT issues??

I have need to make this a cron task, as i suspect this machine will remain on till either the next power failure, or when i finally move from here. I shut it down this time (don't laugh) just to see what would happen!

Also i just checked my ISPs pages, they arent advertising a network time server, and i see little point in trying my luck till i understand how to make it work for me..


Graham L
29-12-2002, 03:09 PM
We've been here and done this.:D "network time server" in PressF1's search locates a thread, with answers from me and someone called Chris Wilson.

My link there seems a bit corrupted by background colour stuff, but I'll try again ... the site is there, but the file has gone. Google should help, and there almost certainly a HOWTO.

29-12-2002, 03:17 PM
Oops :8}

That must have been back when i was totally overwelmed (*1) by my new toy, says a clueless Chris Wilson in some effert to justify his sillyness......


*1 totally overwelmed as opposed so slightly overwelmed

Graham L
29-12-2002, 03:24 PM
Google is helpful as ever. "network time server linux" gives some very good links. You will probably go straight to a SuSe site (sdb.suse.de/en/sdb/html/xntp.html) but the two links to GeodSoft, and redhat appear worth a good look.