Linux 12/24 hour time problems -- arggh!

jrmAtAnand

Junior Member
Mar 2, 2004
1
0
0
A probably blindingly-obvious question, but its answer continues to escape me: I have two x86 boxes both running virtually identical versions of RedHat 9. Unfortunately, one of these machines is not successfully working with my backup system (Dantz Retrospect), while the other one works fine. I've narrowed it down to the following situation:

GoodMachine: hwclock --debug
hwclock from util-linux-2.11y
Using /dev/rtc interface to clock.
Last drift adjustment done at 1077909647 seconds after 1969
Last calibration done at 1077909647 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2004/03/01 19:51:14
Hw clock time : 2004/03/01 19:51:14 = 1078199474 seconds since 1969
Mon Mar 1 19:51:14 2004 -0.813675 seconds

BadMachine: hwclock --debug
hwclock from util-linux-2.11y
Using /dev/rtc interface to clock.
Last drift adjustment done at 1078199348 seconds after 1969
Last calibration done at 1078199348 seconds after 1969
Hardware clock is on local time
Assuming hardware clock is kept in local time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2004/03/01 19:50:48
Hw clock time : 2004/03/01 19:50:48 = 1078199448 seconds since 1969
Mon 01 Mar 2004 07:50:48 PM PST -0.295439 seconds

The difference, of course, is in the last lines of the output, which show that GoodMachine is in one situation, while BadMachine is in the other. I'm assuming that this is because of something I did to BadMachine at some time in the past, and that if I can get BadMachine's hardware clock into the same state as GoodMachine, my problems will go away. But, so far, I haven't found the magic incantation. Can anyone help with this? As I said, it's probably bleeding obvious, but I just haven't been able to find it.

It may be worth mentioning that I also have a Windows ME partition on this (somewhat dated) machine, so Windows has occasionally gotten its hands on the clock...

Thanks,
Jim
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Maybe one computer is set to localtime and the other is to UTC? (utc is universal time convention and uses a standard twenty four hour clock set to greenwich mean time)

So if one is set to the pacific time zone and one is set to UTC then...

7:51 pm PST = 03:51 UTC. (PST is 8 hours behind UTC) So if one thinks it's running at utc and the other thinks it's running at PST, and both have the same times. one will think it's 8 hours earlier/later then it realy is.

I don't know if that is causing it though. To change time in your hardware clock to localtime you use "hwclock --localtime --systohc". Or something like that. I am not realy sure beause I never messed around with it before.

I believe that localtime is set by a symbolic link from /etc/localtime to whatever timezone you want in /etc/share/zoneinfo/

Also check out the /etc/adjtime file and see if they are the same on both machines.

I am not realy sure and am just guessing here, though...

IF all else fails Redhat is capable of using a ntpd deamon to keep itself synced with internet time servers. I think you can turn it on by going to your gnome/kde desktop and going to the preferences for the desktop clock. Looking around there see if you can find the setting to activate it. You may have to install and set up ntpd or a cron job for the ntpdate command. Personally I just keep a simple script that I run everyonce and a while to use the ntpdate command to sync with a time server on the internet. Those will keep you within .05 of a second in sync with the US atomic clocks.
 

pitupepito2000

Golden Member
Aug 2, 2002
1,181
0
0
did the other machine ever have the time correct? Have you checked your clock in the bios? Also is this the problem that you are talking about:
Mon Mar 1 19:51:14 2004 -0.813675 seconds
and the other machine
Mon 01 Mar 2004 07:50:48 PM PST -0.295439 seconds


The time to me seems fine. ONe of them is set to 24 hours format and the other one is set to 12 hour format. There's probably some configuration in redhat. Try dobuleclicking in the clock icon if you are using gui, other wise, try looking at some of your configuration files.

I hope this helps,
pitupepito