Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
System clock always wrong
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
kahlil88
n00b
n00b


Joined: 01 Mar 2009
Posts: 42
Location: Mendocino, CA

PostPosted: Sat Mar 14, 2009 9:39 am    Post subject: System clock always wrong Reply with quote

My system clock is always off by a few hours. I managed to set it with ntpdate once, but after rebooting it's wrong again. My CMOS battery works fine and the time is correct in Windows.
_________________
There is no system but GNU and Linux is one of its kernels.
Join the FSF as an Associate Member!
Back to top
View user's profile Send private message
smerf
l33t
l33t


Joined: 06 Nov 2004
Posts: 778
Location: Polska

PostPosted: Sat Mar 14, 2009 12:47 pm    Post subject: Reply with quote

It is precisely N hours where N is integer? Do you have right time zone selected?

What do you get after egrep ^TIMEZONE=\|^CLOCK= /etc/conf.d/clock?
_________________
Microsoft is not the answer, Microsoft is the question, the answer is no.
Back to top
View user's profile Send private message
Leon_UK
Tux's lil' helper
Tux's lil' helper


Joined: 06 Dec 2006
Posts: 128
Location: London

PostPosted: Sat Mar 14, 2009 12:48 pm    Post subject: Reply with quote

If I recall correctly I don't remember if it was in the handbook or a comment in the "/etc/conf.d/clock" it used to say if you dual boot with windows you should set that file to local or you will keep getting an incorrect time.

Code:
nano -w /etc/conf.d/clock

if you do not have that file it should be
Code:
nano -w /etc/conf.d/hwclock


mine looks like this

Code:
$ cat /etc/conf.d/hwclock
CLOCK="UTC"
TIMEZONE="Europe/London"


Though if you dual boot with windows UTC should be changed to local

Code:
$ cat /etc/conf.d/hwclock
CLOCK="local"
TIMEZONE="Europe/London"


The timezone setting is one other possibility as to what could be causing an incorrect clock, your original setting could have been overwritten in an update or something, to be sure it is not the cause, you could copy that over again.

find your timezone if you do not know it with
Code:
 ls /usr/share/zoneinfo


then (using my timezone as the example)

Code:
cp /usr/share/zoneinfo/Europe/London /etc/localtime


and make sure that is set in /etc/conf.d/clock (or "hwclock" depending on which you have) as mine is above with TIMEZONE=

hopefully this would solve your problem.
_________________
AMD 7750 BE (@3.0ghz) || pci-e 7600GT (@650/800)Nvidia-drivers || 4gb ddr2 || ~amd64(funtoo) ||gentoo-sources-2.6.35-r1
Back to top
View user's profile Send private message
kahlil88
n00b
n00b


Joined: 01 Mar 2009
Posts: 42
Location: Mendocino, CA

PostPosted: Sun Mar 15, 2009 9:29 pm    Post subject: Reply with quote

It worked! Thanks for your help. :D
_________________
There is no system but GNU and Linux is one of its kernels.
Join the FSF as an Associate Member!
Back to top
View user's profile Send private message
jsowoc
n00b
n00b


Joined: 29 May 2005
Posts: 22
Location: Calgary, AB, Canada

PostPosted: Fri Apr 03, 2009 7:01 pm    Post subject: updating Gentoo Documentation Reply with quote

I was getting this exact problem despite following the instructions in the handbook:
http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=1&chap=8#doc_chap3

I didn't know I'm supposed to edit hwclock...
Who should we contact to update the handbook to say: "either use /etc/conf.d/clock or /etc/conf.d/hwclock" ?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54827
Location: 56N 3W

PostPosted: Fri Apr 03, 2009 7:52 pm    Post subject: Reply with quote

jsowoc,

The handbook is written around baselayout1 as that is what stable gentoo provides.
With baselayout2, the setup changes and there is a migration guide to ensure an smooth transition.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Sat Apr 04, 2009 10:39 am    Post subject: Reply with quote

clock in my box was also not working...didnt know why though, as the /etc/conf.d/clock was correct.I removed it and use /etc/conf.d/hwclock and clock working correct.
But I still have that warning Factory settings of the clock as no /etc/conf.d/clock in there...if use this file I get 2hrs ahead of my time regardless of the settings in there.
Where can I tell the system to check /etc/conf.d/hwclock instead?


P:S
baselayout-->sys-apps/baselayout: 1.12.11.1
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54827
Location: 56N 3W

PostPosted: Sat Apr 04, 2009 11:30 am    Post subject: Reply with quote

muhsinzubeir,

There are two scenarios.

1. You dual boot with windows.
In your BIOS, set the time by your wristwatch.
copy /usr/share/zoneinfo/localtime to /etc/localtime
In your /etc/conf.d/clock set your timezone to localtime
You must boot into Windows to get changes in daylight saving time to take effect because windows changes your BIOS time.

2. You use Linux Only
In your BIOS, set the time to UTC
copy /usr/share/zoneinfo/<city_near_you> to /etc/localtime
In your /etc/conf.d/clock set your timezone to <city_near_you>
Daylight savings time changes happen in real time.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
justinkb
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 161

PostPosted: Sat Apr 04, 2009 11:43 am    Post subject: Reply with quote

thanks for clearing that up neddy, i ended up changing the clock for DST in the bios, which gives the same effect as you say.
Back to top
View user's profile Send private message
muhsinzubeir
l33t
l33t


Joined: 29 Sep 2007
Posts: 948
Location: /home/muhsin

PostPosted: Sat Apr 04, 2009 1:13 pm    Post subject: Reply with quote

Thanks Neddy....got it now...issue was in the Bios, i noticed that 3 of my boxes were set utc+2....but I couldnt fix one of them, I cant access the Bios...so I settup ntp-client en I think I can live for a while...
Cheers
_________________
~x86
p5k-se
Intel Core 2 Duo
Nvidia GT200
http://www.zanbytes.com
Back to top
View user's profile Send private message
alatar
n00b
n00b


Joined: 12 Feb 2009
Posts: 61

PostPosted: Sun Apr 05, 2009 5:29 am    Post subject: Reply with quote

NeddySeagoon wrote:
muhsinzubeir,

There are two scenarios.

1. You dual boot with windows.
In your BIOS, set the time by your wristwatch.
......

2. You use Linux Only
In your BIOS, set the time to UTC
.......


What will happen if I set the time to UTC in the first scenario? I am asking because a had done that and my Gentoo works fine. But maybe I am missing something?
Back to top
View user's profile Send private message
justinkb
Apprentice
Apprentice


Joined: 23 Dec 2008
Posts: 161

PostPosted: Sun Apr 05, 2009 6:16 am    Post subject: Reply with quote

your time will be fudged up in windows if you do that.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum