You are not logged in.

#1 2012-05-21 11:33:02

b9anders
Member
Registered: 2007-11-07
Posts: 691

Fixing my clock

I have had this problem several times and for some reason, dealing with the clock remains totally opaque to me. It recurs and I have to google from square one all over again and I never got around to finding a permanent solution.

My problem is very simple. When I boot into windows and return to Linux, the clock in linux is now two hours ahead. I would like for this to never happen again and for the clock to show the proper time in both linux and windows without CLI corrections each time.

from my rc.conf:

HARDWARECLOCK="UTC"
TIMEZONE="Europe/Copenhagen"

Offline

#2 2012-05-21 11:53:29

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: Fixing my clock

I have had this problem before as well. This might help you with your problem: https://bbs.archlinux.org/viewtopic.php?id=126195

Offline

#3 2012-05-21 12:06:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,548
Website

Re: Fixing my clock

Doesn't windows set the harware clock to localtime by default?  Have you put windows on UTC?  What version of windows is it?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2012-05-21 13:05:27

b9anders
Member
Registered: 2007-11-07
Posts: 691

Re: Fixing my clock

Trilby wrote:

Doesn't windows set the harware clock to localtime by default?  Have you put windows on UTC?  What version of windows is it?

7. I wasn't even aware windows let you fiddle with these kind of settings tbh.

Offline

#5 2012-05-21 13:13:25

b9anders
Member
Registered: 2007-11-07
Posts: 691

Re: Fixing my clock

Maybe this will tell you what you need to know:

# hwclock
man 21 maj 2012 17:10:26 CEST  -0.516293 seconds
# hwclock -D
hwclock from util-linux 2.21.1
Using /dev interface to clock.
Last drift adjustment done at 1329731760 seconds after 1969
Last calibration done at 1329731760 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2012/05/21 15:11:13
Hw clock time : 2012/05/21 15:11:13 = 1337613073 seconds since 1969
man 21 maj 2012 17:11:13 CEST  -0.989548 seconds

The plain 'hwclock' command is off by two hours, but hwclock -D shows the actual time. How do I fix this?

Sorry, but for some reason I go stupid trying to get how the clock works in Linux (which is why I posted in the beginners forum).

Offline

#6 2012-05-21 13:29:21

ploub
Member
Registered: 2007-05-16
Posts: 132

Re: Fixing my clock

I am in complete agreement with you. The only fix that worked for me was the windows registry one.
Edit: and set hwclock to UTC in /etc/rc.conf

Last edited by ploub (2012-05-21 13:54:20)

Offline

#7 2012-05-21 13:34:42

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Fixing my clock

To stop Windows fiddling with the clock: dbl-click the clock on the taskbar, click "Internet Time" tab and uncheck "Automatically synchronize...". 

I think you have to set your clock to localtime if you want both Arch and Windows to display the correct time.  If you observe any sort of daylight savings it's worse, since Windows will modify your hw clock, and Linux will modify your sys clock...


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#8 2012-05-21 13:40:35

rg_arc
Member
Registered: 2011-03-20
Posts: 507

Re: Fixing my clock

I have hwclock disabled in my rc.conf:

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
DAEMONS=(@syslog-ng alsa dbus networkmanager pdnsd ntpd !hwclock @crond ibus cupsd gdm bitlbee)

and I made sure to use ntp with the ntpd daemon enabled and hwclock disabled. I modified the ntp.conf file to meet my needs and I haven't had any trouble since. That thread I mentioned earlier sort of directed me to make most of those changes.

Also... have you tried:

# hwclock --systohc --utc

Last edited by rg_arc (2012-05-21 13:44:39)

Offline

Board footer

Powered by FluxBB