You are not logged in.

#1 2010-08-04 22:38:08

CheatCat
Member
Registered: 2009-07-10
Posts: 54

The clock goes wrong

I set the clock to the time right now, that works ok until I shutdown the computer and turn it on next day. Then the clock show wrong time. I have set the hardware clock as well, but that also go wrong next day. How can I fix it? Please help me. sad

Offline

#2 2010-08-04 22:43:55

Woofie
Member
From: RK, Czech Rep.
Registered: 2009-12-28
Posts: 83

Re: The clock goes wrong

Have you try NTP?
Here is some info http://wiki.archlinux.org/index.php/NTP


Sorry for my english. It's not my native language..

Offline

#3 2010-08-04 23:48:52

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: The clock goes wrong

What timezone are you in?

Have you told your computer?  (/etc/rc.conf)


Knute

Offline

#4 2010-08-04 23:56:22

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: The clock goes wrong

http://wiki.archlinux.org/index.php/Time#Time_Skew

We need more info: is it off by an hour, a couple minutes, is your clock set to localtime, are you dualbooting with Windows?

Offline

#5 2010-08-05 01:26:12

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: The clock goes wrong

Is your hardware clock correct?

Offline

#6 2010-08-05 01:32:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: The clock goes wrong

itsbrad212 wrote:

Is your hardware clock correct?

CheatCat wrote:

I have set the hardware clock as well, but that also go wrong next day.

Offline

#7 2010-08-05 08:28:16

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: The clock goes wrong

itsbrad212 wrote:

Is your hardware clock correct?

check it in BIOS


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#8 2010-08-05 08:34:54

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: The clock goes wrong

nTia89 wrote:
itsbrad212 wrote:

Is your hardware clock correct?

check it in BIOS

Or 'hwclock -r' if you keep it on localtime. 'hwclock --utc' is the other choice.

Offline

#9 2010-08-05 08:39:25

damdim
Member
Registered: 2010-03-13
Posts: 48

Re: The clock goes wrong

It might be the cmos battery...

Offline

#10 2010-08-05 09:33:21

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: The clock goes wrong

Try this (helps in most such cases):
- Look at the /var/lib/hwclock/adjtime file contents. The first field should contain a rather low absolute value.
- If the value apears too high, remove the /var/lib/hwclock/adjtime file and
- properly set your system system time and then
- synchronize the hardware clock to this (as root): hwclock --systohc. (See: man hwclock.)
- Then reboot your system. This restores the /var/lib/hwclock/adjtime file.
- If in doubt, check this file again (repeatedly). If the value is still high or returns to a high value after some time, you probably have a hardware or setup problem.

Last edited by bernarcher (2010-08-05 09:35:24)


To know or not to know ...
... the questions remain forever.

Offline

#11 2010-08-05 15:17:24

jlacroix
Member
Registered: 2009-08-16
Posts: 576

Re: The clock goes wrong

Try these commands (works for me). I actually put these in a script I run from time to time when this happens:

pacman -S openntpd
rm /var/lib/hwclock/adjtime
ntpd -s -d

After that runs for a while, press CTRL+C to quit and then reboot.

Offline

#12 2010-08-05 16:23:40

CheatCat
Member
Registered: 2009-07-10
Posts: 54

Re: The clock goes wrong

My timezone is CEST right now, and /etc/rc.conf are set to Europe/Stockholm right now.

Woofie wrote:

Have you try NTP?
Here is some info http://wiki.archlinux.org/index.php/NTP

That is not really a solution. How about if you have to work offline?

karol wrote:

We need more info: is it off by an hour, a couple minutes, is your clock set to localtime, are you dualbooting with Windows?

Right now it is 5 hours and some mins before the now time. No idea what the clock are set to and no, I am dualbooting, but I never run Windows.
The hwclock go 20 hours after the current time.

damdim wrote:

It might be the cmos battery...

Then BIOS should give me warnings, right?


Here is my /var/lib/hwclock/adjtime file:

-55166.954837 1280952257 0.000000
1280931635
UTC

Offline

#13 2010-08-05 16:28:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: The clock goes wrong

Here's mine:
17.364907 1281024490 0.000000
1280936227
LOCAL

From the manpage:
       The format of the adjtime file is, in ASCII:

       Line 1: 3 numbers, separated by blanks: 1) systematic drift rate in seconds per day, floating point  decimal;
       2)  Resulting  number of seconds since 1969 UTC of most recent adjustment or calibration, decimal integer; 3)
       zero (for compatibility with clock(8)) as a decimal integer.

       Line 2: 1 number: Resulting number of seconds since 1969 UTC of most recent calibration.  Zero if  there  has
       been  no calibration yet or it is known that any previous calibration is moot (for example, because the Hard‐
       ware Clock has been found, since that calibration, not to contain a valid time).  This is a decimal integer.

       Line 3: "UTC" or "LOCAL".  Tells whether the Hardware Clock is set to Coordinated  Universal  Time  or  local
       time.  You can always override this value with options on the hwclock command line.

Offline

#14 2010-08-05 18:40:30

CheatCat
Member
Registered: 2009-07-10
Posts: 54

Re: The clock goes wrong

This is what happens: when I start linux the hardware clock CHAGES. Why?

Offline

#15 2010-08-05 18:45:38

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: The clock goes wrong

CheatCat wrote:

This is what happens: when I start linux the hardware clock CHAGES. Why?

You cna sync clocks both ways: system to hardware and the other way round.
Try using localtime in your rc.conf, set both clocks the way you want and remove /var/lib/hwclock/adjtime then reboot.

Offline

#16 2010-08-05 18:46:31

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: The clock goes wrong

From the wiki (http://wiki.archlinux.org/index.php/Time)

wiki wrote:

Operating systems also have a software clock (aka the system clock) that runs independent of the hardware clock. The system clock keeps track of the time, time zone, and whether or not your location uses Daylight Savings Time (DST). The Arch Linux script (/etc/rc.sysinit) sets the system clock from the hardware clock on boot, and the script (/etc/rc.shutdown) sets the hardware clock from the system clock on shutdown. Users often use NTP to keep the system clock set to the proper time.

If you read that page it will tell you how to remedy your situation.

Offline

#17 2010-08-05 21:22:01

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: The clock goes wrong

CheatCat wrote:

Here is my /var/lib/hwclock/adjtime file:

-55166.954837 1280952257 0.000000
1280931635
UTC

This -55166.954837 is a far too big value! Get rid of this file soon. It is one main cause of your time problems.
This is what I get:

0.008190 1281013888 0.000000
1281013888
UTC

Anything above |10| is suspicious (and this is a rather high value already).


To know or not to know ...
... the questions remain forever.

Offline

#18 2010-08-05 21:31:25

Skripka
Member
From: 2X1280X1024
Registered: 2009-02-19
Posts: 555

Re: The clock goes wrong

CheatCat wrote:
damdim wrote:

It might be the cmos battery...

Then BIOS should give me warnings, right?

No it should not.  I've never seen a mainboard that gives warnings for low CMOS battery.

Offline

#19 2010-08-05 21:46:04

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: The clock goes wrong

You won't get warnings from the BIOS if the CMOS battery gets low. But once the timer starts to behave irregularly chances are that soon the CMOS contents will not been held anymore.

I experienced the opposite, timer running ok but my CMOS settings went astray and I was not able to boot anymore.

Yet, it is a rather unlikely scenario. I have a 15-year old PC here which still runs on its original battery. In the case of the OP I would try to get rid of adjtime first, and then install ntp or openntp to keep synchronization. Only if this fails, I would suspect the hardware.

Last edited by bernarcher (2010-08-05 21:48:18)


To know or not to know ...
... the questions remain forever.

Offline

#20 2010-08-07 11:07:28

CheatCat
Member
Registered: 2009-07-10
Posts: 54

Re: The clock goes wrong

Thank you, I think I fixed it by removing the /var/lib/hwclock/adjtime file. I will report later if the clock goes wrong again. Right now it seem to go one minute after, lol. tongue

Offline

Board footer

Powered by FluxBB