You are not logged in.

#1 2012-04-21 12:34:49

verduler
Member
Registered: 2011-09-27
Posts: 9

Changing hour every time i restart the system

Since i installed the distro, 1 year ago, the hour changes every time i restart the system. I've searched the forums and I've done my best following the wiki instructions but for now i can't get it working.
Any ideas?

Thank you in advance for your help.

Manel.

rc.conf:

#
# /etc/rc.conf - Main Configuration for Arch Linux
#
# See 'man 5 rc.conf' for more details
#

# LOCALIZATION
# ------------
HARDWARECLOCK="UTC"
TIMEZONE="Europe/Madrid"
KEYMAP="es"
CONSOLEFONT=
CONSOLEMAP=
LOCALE="ca_ES.UTF-8"
DAEMON_LOCALE="yes"
USECOLOR="yes"

# HARDWARE
# --------
MODULES=()
USEDMRAID="no"
USEBTRFS="no"
USELVM="no"

# NETWORKING
# ----------
HOSTNAME="ManelOrdinador"

interface=eth0
address=
netmask=
broadcast=
gateway=

NETWORK_PERSIST="no"

# DAEMONS
# -------
#
DAEMONS=(hwclock syslog-ng dbus networkmanager netfs crond gdm @cupsd)

Offline

#2 2012-04-21 12:56:32

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,372

Re: Changing hour every time i restart the system

I have this problem, but only if I happen to have had to boot Windows (which, fortunately, is rare), and whilst there are several solutions for keeping both OSes in sync dotted about the web, none of them worked here. What did work is to create a startup script on Arch that grabs the system time from an ntp server, and then sets the hardware clock with the correct system time (hwclock --systohc).

Note - you have to have the script running as root, so set it to run at bootime rather than as a startup for X.

An alternative method is detailed here


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus B550-F Gaming MB, 128Gb Corsair DDR4, Fractal Design Define 7 XL, 5 HD (2 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

/ is the root of all problems.

Offline

#3 2012-04-21 15:27:10

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: Changing hour every time i restart the system

Please post the output of hwclock --debug


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2012-04-22 09:01:56

verduler
Member
Registered: 2011-09-27
Posts: 9

Re: Changing hour every time i restart the system

This is the output of hwclock --debug. It's a translation because my locale isn't english sad

Using / dev interface to clock.
The Last drift adjustment was 1335050809 seconds after 1969
Last calibration done at 1332660780 seconds after 1969
The hardware clock is UTC
Assuming hardware clock keeps UTC time.
Waiting for clock tick ...
received ... the clock tick
Time read from Hardware Clock: 04.22.2012 10:38:11
Hardware Time: 22/04/2012 10:38:11 = 1335091091 seconds after 1969
Sun April 22 2012 12:38:11 CEST -0.381791 seconds

Thank you.

ewaller wrote:

Please post the output of hwclock --debug

Offline

#5 2012-04-22 09:08:49

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Changing hour every time i restart the system

Try adding HARDWARECLOCK="localtime" in your /etc/rc.conf. Especially if you dual boot with Windows.


And please use [ code ] tags. They're easier to follow.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#6 2012-04-22 14:13:54

verduler
Member
Registered: 2011-09-27
Posts: 9

Re: Changing hour every time i restart the system

Thank you! now it's working!!

Thank you very much again to everybody.
Next time i promise to use the  code  tags

DSpider wrote:

Try adding HARDWARECLOCK="localtime" in your /etc/rc.conf. Especially if you dual boot with Windows.


And please use [ code ] tags. They're easier to follow.

Offline

#7 2012-04-22 15:46:46

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: Changing hour every time i restart the system

verduler wrote:

This is the output of hwclock --debug. It's a translation because my locale isn't english

FYI.  You can prepend LC_ALL=C to a command to force English output.  Example:
LC_ALL=C hwclock --debug
Could have saved you some translating smile
If you are happy with the clock set to localtime, great.  I prefer having it set to UTC for a variety of reasons that have been discussed on these forums that I'll not repeat here.

The hardware clock is UTC

Your system assumed the clock was set to UTC

Time read from Hardware Clock: 04.22.2012 10:38:11
Hardware Time: 22/04/2012 10:38:11 = 1335091091 seconds after 1969
Sun April 22 2012 12:38:11 CEST -0.381791 seconds

The system shows your time as being two hours ahead of UTC.  UTC does not have summer/winter time adjustments.  I assume that you are one hour ahead of UTC, plus an extra hour of adjustment for summer.

The post I took this from was posted at 01:01:56 PDT (UTC-7).  What time (your local time) did you make that post?
If it took you 20 minutes for the translation tongue your hardware clock at the time would have been about 11:01.  That is  10 hours ahead of me.
I am confused, because I expected it to be about 9.  If things are working right, it should be 7.

Anyway, it would appear if the change you made fixed things then your hardware clock was not set to UTC.  If you want to pursue this, I am glad to help.  If not, I am sure we will be talking about clock settings this fall tongue


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#8 2012-04-23 21:00:30

verduler
Member
Registered: 2011-09-27
Posts: 9

Re: Changing hour every time i restart the system

ewaller, thank you for your response and interest! at this moment i'm so happy seeing the correct hour on the screen that all that i want is enyoi it!!! wink
I live in Barcelona so, teorically my UTC is UTC + 2. During all this time with UTC the time has been changing every time i started the computer but without following a pattern. So one day the time was 30 min. ahead the real time, another day 2 hours before and so on...  a bit crazy! smile

I have Windows installed on another partition, but I rarely started it.



ewaller wrote:
verduler wrote:

This is the output of hwclock --debug. It's a translation because my locale isn't english

FYI.  You can prepend LC_ALL=C to a command to force English output.  Example:
LC_ALL=C hwclock --debug
Could have saved you some translating smile
If you are happy with the clock set to localtime, great.  I prefer having it set to UTC for a variety of reasons that have been discussed on these forums that I'll not repeat here.

The hardware clock is UTC

Your system assumed the clock was set to UTC

Time read from Hardware Clock: 04.22.2012 10:38:11
Hardware Time: 22/04/2012 10:38:11 = 1335091091 seconds after 1969
Sun April 22 2012 12:38:11 CEST -0.381791 seconds

The system shows your time as being two hours ahead of UTC.  UTC does not have summer/winter time adjustments.  I assume that you are one hour ahead of UTC, plus an extra hour of adjustment for summer.

The post I took this from was posted at 01:01:56 PDT (UTC-7).  What time (your local time) did you make that post?
If it took you 20 minutes for the translation tongue your hardware clock at the time would have been about 11:01.  That is  10 hours ahead of me.
I am confused, because I expected it to be about 9.  If things are working right, it should be 7.

Anyway, it would appear if the change you made fixed things then your hardware clock was not set to UTC.  If you want to pursue this, I am glad to help.  If not, I am sure we will be talking about clock settings this fall tongue

Offline

#9 2012-04-24 12:24:28

Pres
Member
Registered: 2011-09-12
Posts: 423

Re: Changing hour every time i restart the system

I had this same issue on a dual boot with Windows. The problem is that Windows wants your hardware clock to be set to local time (and Arch Linux uses UTC by default). Since I saw this as a problem with Windows, I fixed it there by setting a registry value to force UTC time for the hardware clock. I forget where that was located, but you should be able to find it by googling.

Offline

Board footer

Powered by FluxBB