Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use ArchLinux and I have had problems with my system time for many months.

Previously it was working, but once I updated my PC, the system time was shifted at every startup (like it wasn't detecting timezone, while timezone in rc.conf was and is correct).

Then I added hwclock and it was the same, and removed it. If I remember correctly, this seems to have solved the problem.

When Daylight Saving time changed in my country, The time was shifting by 1 hour at every startup (no matter how many times I set system time manualy or by ntpdate).

I again tried to fix this, and now it has many hour shift like prevously (The shift value is difference of UTC and local time). And now, seems that my system time is unchangable. I set time with date -s ... and ntpdate pool.ntp.org for example... but these measures do not seem to persist after a reboot. I tried it with hwclock daemon running, ntpd running, and none of them running in DAEMONS. I'm really confused about this.

I dont use windows very much. And I know booting windows can cause problems in linux with the system time. But thats not my problem. Every time I boot windows and linux, I can reset system time by hand or ntpdate command. So you can suppose I have not any windows on my machine.

I just want to my system time work and not changed automatically (via ntp or something), just set it manually (by hand, or ntpdate command) when I want. Please help.

Here is my rc.conf: http://pastebin.com/F3qXuxFj

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

Ilius, I think I've come across this problem before.

  1. First try to set the system time correctly. (ntp/whatever)
  2. Then, run hwclock --systohc

This should reset your hwclock to the system time, and should be persistent across reboot.

would you let us know if it works out?

share|improve this answer
    
Great! It worked, thanks. –  ilius Sep 26 '11 at 13:37
    
But it works with both having hwclock in DAEMONS and not having. Can you describe me what does hwclock do exactly? –  ilius Sep 26 '11 at 13:38
1  
hwclock isn't a daemon. It's a utility that writes to the hardware clock register (I think) on your processor/motherboard. This register is kept ticking by the button battery when you power off your computer. Try a man hwclock to find out more. –  brice Sep 26 '11 at 14:02
add comment

You've got HARDWARECLOCK set to UTC in your rc.conf. I think that's the culprit. If you're in dual boot situation with windows you should have it set to "localtime" (see arch installation docs IIRC).

Another cause of your problem could be messed startup scripts because arch should perform "--hctosys" and "--systohc" during startups/shutdowns.

In linux you have to differentiate between system clock (let's call it SC) and hardware clock (HC). They are separate but interconnected. Time in SC (real time) is calculated knowing how HC is set (local time or UTC) and what system's time zone is. In windows there's no calculation – HC value is SC value. So, if UTC differs from your local time, linux is set to treat HC as set to UTC and linux SC shows proper time, windows will show rubbish. If, conversely, windows' time is set correctly and linux treats HC as set to UTC then linux' SC shows time "shifted". The solution would be to make linux treat HC as set to local time (HARDWARECLOCK="localtime").

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.