LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   utc-time 2 hours off (http://www.linuxquestions.org/questions/debian-26/utc-time-2-hours-off-825826/)

dranach 08-12-2010 11:02 AM

utc-time 2 hours off
 
I have a problem with utc time on Debian Lenny Desktop (gnome).
UTC time on my box is 2 hours off with the real UTC time.
Since my timezone is Europe/Brussels (CEST), it adds another 2 hours to the (wrong) UTC time.
I installed ntp, ntpdate; I tried changing ntp-server.. To no avail.
Timezone is correctly set up as 'Europe/Brussels' with dpkg-reconfigure tzdata.
Anyone a suggestion on how to solve this problem?

TIA.

zootboy 08-12-2010 12:08 PM

Have you checked the ntp logs to see if it's updating properly? UTC is UTC, and the system clock runs it. For the timezone, the computer calculates the shift whenever it reads the clock, it never adjusts the clock to local time.

One exception, though. Are you dual-booting with Windows? If so, Windows will adjust the system clock to local time.

tredegar 08-12-2010 12:10 PM

Check that your hwclock is set to use UTC, not localtime. If not, make it so:
Code:

hwclock  --utc
Then sync with ntp
Code:

ntpdate  pool.ntp.org
If your distro doesn't sync the hwclock to the system time at shutdown, you may wish to do this:
Code:

hwclock --systohc
If that doesn't fix it, check if you have a TZ environment variable set to something strange
Code:

env  |  grep  TZ
Hope this helps.

zootboy 08-12-2010 12:13 PM

Thanks for listing the commands, but remember that if you are dual-booting to Windows, don't set the system clock to UTC, set it to local time. That'll keep Windows happy.

dranach 08-13-2010 03:10 AM

Code:

ntpdate pool.ntp.org
did the trick. I first had to uninstall ntp, though.
Thanks

zootboy 08-13-2010 11:51 AM

You should check to make sure ntpd is running on boot, that'll keep the clock in sync.

dranach 08-15-2010 03:31 AM

Apparently the problem is only on my debian computer (lenny). I tried installing ntp on another computer, without problems. I'll have to look into it, later perhaps.

Thanks for the suggestions.

Rita G. 08-20-2010 02:03 PM

try:
/etc/default/rcS
change:
UTC=yes to UTC=no
then set system clock in BIOS.

evo2 08-20-2010 07:28 PM

Two hours is too big a time difference for ntp to be able to correct.

Easiest fix that won't mess with your system is that next time your machine is off for more than two hours correct the hw clock in the bios before booting into your os. If you don't wait the two hours before adjusting the clock back then there will be files on your machine with timestamps in the future. Most programs deal with this ok, but if the two hours downtime is not a problem for you, you might as well use that approach.

Cheers,

Evo2.

evo2 08-20-2010 07:30 PM

Quote:

Originally Posted by Rita G. (Post 4072667)
try:
/etc/default/rcS
change:
UTC=yes to UTC=no
then set system clock in BIOS.

What *good* reason is there to not use UTC?

Evo2.


All times are GMT -5. The time now is 12:39 PM.