You are not logged in.

#1 2009-11-19 14:45:39

jmak
Member
Registered: 2008-12-21
Posts: 453

The date and time setting go crazy[SOLVED]

Hello,

Each time, I boot up the time setting changes. Sometime two hours behind, sometimes five. Even if I set the time and date by using the "date -s" command or kde time setting feature when reboot the time changes.

Any idea how to fix this for good?
Thanks,
jmak

Last edited by jmak (2009-11-20 00:19:17)

Offline

#2 2009-11-19 14:51:24

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: The date and time setting go crazy[SOLVED]

Probably your CMOS battery got discharged.

http://en.wikipedia.org/wiki/CMOS_Battery#CMOS_battery

Offline

#3 2009-11-19 14:58:12

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: The date and time setting go crazy[SOLVED]

First thing I would do is check that my timezone is (i.e. no errors in it) in rc.conf.  Then I would remove adjtime.  When there are clock skews, hwclock adjusts the time gradually with the ntp client by setting drift values.  The file is locate at /var/lib/hwclock/adjtime.  Next I'd be sure the battery in my computer is good, then I would look into the bios settings.

Be a little more verbose but gotta run smile.

Last edited by Gen2ly (2009-11-19 15:00:34)


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#4 2009-11-19 17:26:26

jmak
Member
Registered: 2008-12-21
Posts: 453

Re: The date and time setting go crazy[SOLVED]

Thanks for all the suggestions.

This what happened. From some strange reasons the system clock setting and the distro setting were different. The bios clock was two hours before the distro clock. I adjusted the bios clock to real time—to correct time thinking this will set the disto time to the correct time too. Rebooted and I was put on the commandline with an error message:"superblock last mount time Thu Nov 19 11:41:29 2009, now=Thu Nov 19 10::53:27 2009 is in the future"
Then I entered the root password and did a "fsck" and rebooted. It booted up fine
but the distro time setting was still wrong. Rebooted again and checked the bios clock and it was reset to the distro clock. Both were wrong but at least have the same settings. Then I boot up again and set the time to the right setting in KDE. Rebooted and checked the bios clock which was adjusted to the distro setting—in other words to the correct settings. Now the time is ok. So it seems that the bios setting depends on the distro setting. I thought it was the other way around.

My computer is relatively new, 2 years old, so I dont think this was a battery problem. Also, I have other distros installed and I haven't experienced these kinds of problems with those distros.

Lately, I experimented with a few distros on different partitions, and what I am suspecting is that those might reset the bios clock which caused the inconsistencies in Kde.

jmak

Offline

#5 2009-11-19 17:50:30

MadTux
Member
Registered: 2009-09-20
Posts: 553

Re: The date and time setting go crazy[SOLVED]

What is your HARDWARECLOCK setting in /etc/rc.conf "UTC" or "localtime"?

You may be interested in setting up ntp:

http://wiki.archlinux.org/index.php/NTP

Offline

#6 2009-11-19 22:27:14

jmak
Member
Registered: 2008-12-21
Posts: 453

Re: The date and time setting go crazy[SOLVED]

It was too early to celebrate because after reboot I got a wrong time setting again. This time I got 2 hours ahead of local time.

I'm lost.

This is the hardwareclock setting.

LOCALE="en_US.UTF-8"
HARDWARECLOCK="localtime"

Offline

#7 2009-11-19 22:48:10

corsakh
Member
Registered: 2009-11-08
Posts: 104

Re: The date and time setting go crazy[SOLVED]

Just wanted to say that same here. Today I was even more shocked - I loaded in New York time though I am in Sydney smile

Offline

#8 2009-11-19 23:05:51

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: The date and time setting go crazy[SOLVED]

Hmm.

What you might want to do jmak is set the system (distro) clock via the command line then set the bios time:

date MMDDHHMMYYYY
hwclock --systohc

Then reboot and automatically check for hard-drive errors (if timestamps are in the future you'll get the same error as before and this will automatically do it):

shutdown -Fr now

You'll need to be root to do these then you should be good.  Oh, I'd also do the adjtime thing I recommended above.

Last edited by Gen2ly (2009-11-19 23:06:10)


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#9 2009-11-20 00:18:39

jmak
Member
Registered: 2008-12-21
Posts: 453

Re: The date and time setting go crazy[SOLVED]

Thanks Gen2ly,

This seems to solved the problem. I also removed the adjtime file and rebooted a few times to see that the time persists. So far ok.

Offline

#10 2009-11-29 13:25:47

manouchk
Member
Registered: 2008-07-29
Posts: 306

Re: The date and time setting go crazy[SOLVED]

Well, that's crazy, I'm having this problem here also with my laptop.
I'm using openntpd service for sometimes but it does not solve the problem because it cannot before checking file system which is the problem. Checking is done for "every" journalized partitions (on my system I have to reboot twice, which is very annoying) ifsome block are in the future. On my system after opnntpd running, the time difference is kept:

hwclock
jeu. 26 nov. 2009 07:37:52 BRST  -0.365878 secondes
[11:10][manu@compal:~]$ date
dim. nov. 29 11:10:23 BRST 2009


Clearly openntpd does actualize hardware clock after adjusting time. Anyone knows how to force openntpd to actualize hwclock?

Same problem here:
http://bbs.archlinux.org/viewtopic.php?id=81560

I guess there is a bug in archlinux or very new wired behaviour which affects quite a lot of users.

Offline

#11 2009-11-29 13:28:12

manouchk
Member
Registered: 2008-07-29
Posts: 306

Re: The date and time setting go crazy[SOLVED]

I'm guesisng that it may be a problem for people using windows dual boot. I remembered tht it may have started when I installed back a windows dual boot...

Are most people having this problem using a dual boot?

It looks like the problem could be solved by using UTC on archlinus and windows see:
http://bbs.archlinux.org/viewtopic.php?id=81560

Offline

#12 2009-11-29 13:31:46

manouchk
Member
Registered: 2008-07-29
Posts: 306

Re: The date and time setting go crazy[SOLVED]

I think setting hardware clock may the fix:
sudo hwclock --systohc

hwclock
dim. 29 nov. 2009 11:29:31 BRST  -0.306756 secondes

date
dim. nov. 29 11:29:32 BRST 2009

One can check that rebooting is okay after that.

To check if the problem is with windows on dual boot; Boot windows and then come back to linux, hardware clock will be different to real local time...

Offline

Board footer

Powered by FluxBB