LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-12-2010, 11:02 AM   #1
dranach
LQ Newbie
 
Registered: Oct 2009
Location: vlaanderen
Distribution: debian, sometimes sprinkled with a touch of fluxbox; ubuntu on occasion,
Posts: 14

Rep: Reputation: 0
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.
 
Old 08-12-2010, 12:08 PM   #2
zootboy
Member
 
Registered: Nov 2008
Location: In a dumpster, with my laptop.
Distribution: Fedora
Posts: 124

Rep: Reputation: 25
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.
 
Old 08-12-2010, 12:10 PM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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.
 
1 members found this post helpful.
Old 08-12-2010, 12:13 PM   #4
zootboy
Member
 
Registered: Nov 2008
Location: In a dumpster, with my laptop.
Distribution: Fedora
Posts: 124

Rep: Reputation: 25
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.
 
Old 08-13-2010, 03:10 AM   #5
dranach
LQ Newbie
 
Registered: Oct 2009
Location: vlaanderen
Distribution: debian, sometimes sprinkled with a touch of fluxbox; ubuntu on occasion,
Posts: 14

Original Poster
Rep: Reputation: 0
Code:
ntpdate pool.ntp.org
did the trick. I first had to uninstall ntp, though.
Thanks
 
Old 08-13-2010, 11:51 AM   #6
zootboy
Member
 
Registered: Nov 2008
Location: In a dumpster, with my laptop.
Distribution: Fedora
Posts: 124

Rep: Reputation: 25
You should check to make sure ntpd is running on boot, that'll keep the clock in sync.
 
Old 08-15-2010, 03:31 AM   #7
dranach
LQ Newbie
 
Registered: Oct 2009
Location: vlaanderen
Distribution: debian, sometimes sprinkled with a touch of fluxbox; ubuntu on occasion,
Posts: 14

Original Poster
Rep: Reputation: 0
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.
 
Old 08-20-2010, 02:03 PM   #8
Rita G.
Member
 
Registered: Jan 2008
Posts: 157

Rep: Reputation: 25
try:
/etc/default/rcS
change:
UTC=yes to UTC=no
then set system clock in BIOS.
 
Old 08-20-2010, 07:28 PM   #9
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
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.
 
Old 08-20-2010, 07:30 PM   #10
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by Rita G. View Post
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.
 
  


Reply

Tags
utc



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Timzone Issues...Local Time versus UTC time? as400 Solaris / OpenSolaris 12 09-26-2008 12:40 PM
Time is not using local time but uses UTC acummings Debian 2 11-03-2007 01:58 PM
Accessing UTC time yashwantpinge Programming 1 02-22-2006 05:32 AM
Cannot set time/date to other time zone than UTC (Kubuntu) jamangold Ubuntu 1 12-23-2005 05:42 PM
Re: UTC Time unixfreak Linux - Newbie 2 08-30-2004 02:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration