Operating System - Linux
1752794 Members
6407 Online
108789 Solutions
New Discussion

Re: time changes, when configured as ntp client

 
SOLVED
Go to solution
Matti_Kurkela
Honored Contributor

Re: time changes, when configured as ntp client

Sorry. The hwclock command seems to always display the BIOS clock time as translated to your local timezone.

The hwclock man page says:
--show Read the Hardware Clock and print the time on Standard Output. The time shown is always in local time, even if you keep your Hardware Clock in Coordinated Universal Time.

You should be able to verify this by this procedure:
1.) make sure your timezone is correctly set
2.) synchronize your system clock with ntpdate (verify with "date" and "date -u")
3.) run "hwclock --systohc --utc"
4.) reboot the machine and view the clock in the BIOS menu; you should see it's running in UTC time.

As to why the Unix timezone setting of "GMT-6" means "local time is GMT _plus_ 6 hours", that's what the POSIX.1 standard says. Blame the committee that defined the standard, if you wish... But remember that the sign of the number in the timezone designation is the opposite of what you would expect.

MK
MK
Maaz
Valued Contributor

Re: time changes, when configured as ntp client

Hi Matti Kurkela,

# ntpdate clock.nc.fukuoka-u.ac.jp

# date && date -u && hwclock
Fri Jun 6 10:48:45 GMT-6 2008
Fri Jun 6 04:48:45 UTC 2008
Fri Jun 6 10:48:45 2008 -0.000421 seconds

then I ran,
# hwclock --systohc --utc

reboot the system to check the BIOS time, it is still 6 hours different. the BIOS clock is showing the same time as the output of "date -u" command.

but always the hwclock and date command reports the same and right time.

This is not a big issue.

Anyhow thanks once again.
Regards
Maaz