You are not logged in.

#1 2012-08-20 17:18:22

sim590
Member
Registered: 2012-07-22
Posts: 31

[SOLVED] Hardware and system clock problem

Hello, I'm new to Arch Linux and I love it. But I'm facing a problem which I can't find the solution anywhere: Time displayed in gnome (I use gnome GUI) and from the output of "date" are wrong. In addition to this: Since I installed archlinux, the time on windows (which is on another partition on the same disk) is wrong too.

Here's the ouput of "hwlock --debug"

hwclock de util-linux 2.21.2
Utilisant /dev interface to clock.
On assume que l'horloge matérielle est conservée dans le temps de UTC.
En attente d'un tic d'horloge…
… a obtenu un tic d'horloge
Heure lue de l'horloge matérielle : 2012/08/20 16:03:30
Heure de l'horloge matérielle : 2012/08/20 16:03:30 = 1345478610 secondes depuis 1969
lun 20 aoû 2012 12:03:30 EDT  -0.644257 secondes

(I use french system, sorry big_smile)

Here's the output of "date"

lun aoû 20 12:10:19 EDT 2012

The thing is, that the real time where I live is 13:10. I don't know if I should use EDT or UTC. I have already searched on Beginners' Guide - ArchWiki - Wiki - Arch Linux and Time - ArchWiki but I haven't figured out how to solve the problem. I usually find solution myself in other forum topics and/or tutorials, but now I can't find it and i'm lacking patience.

Thank you

Last edited by sim590 (2012-09-11 19:21:28)

Offline

#2 2012-08-20 17:47:46

Zancarius
Member
From: NM, USA
Registered: 2012-05-06
Posts: 207

Re: [SOLVED] Hardware and system clock problem

sim590 wrote:

The thing is, that the real time where I live is 13:10. I don't know if I should use EDT or UTC. I have already searched on Beginners' Guide - ArchWiki - Wiki - Arch Linux and Time - ArchWiki but I haven't figured out how to solve the problem. I usually find solution myself in other forum topics and/or tutorials, but now I can't find it and i'm lacking patience. Thank you

If you're using iniscripts, post your rc.conf since I assume you have HARDWARECLOCK set to "localtime" (or post /etc/adjtime and /etc/timezone if you're using systemd or have configured your system with the latest instructions).

Where do you live? The timezone setting should match your location. If you live on the Eastern US coast, either "America/New_York" or "EST5EDT" should work. If you live in France, "CEST" or "Europe/Paris" should work. Be sure to either symlink or copy the appropriate zoneinfo file from /usr/share/zoneinfo to /etc/localtime. Also set the appropriate values in either rc.conf or /etc/timezone. The latter is for systemd compatibility, but I can't say for certain if it will replace the rc.conf values (as I understand it, your old rc.conf settings should still work).


He who has no .plan has small finger.
~Confucius on UNIX.

Offline

#3 2012-08-20 19:16:50

sim590
Member
Registered: 2012-07-22
Posts: 31

Re: [SOLVED] Hardware and system clock problem

Here's the configuration of the file "rc.conf":

#
# /etc/rc.conf - configuration file for initscripts
#
# Most of rc.conf has been replaced by various other configuration
# files. See archlinux(7) for details.
#
# For more details on rc.conf see rc.conf(5).
#

TIMEZONE=Canada/Eastern

DAEMONS=(syslog-ng dbus networkmanager !network crond)

# Storage
#
# USEDMRAID="no"
# USELVM="no"

# Network
#
interface=eth0
address=
netmask=
gateway=

In fact, I have configured the system with the latest instructions and created the files that systemd needs. But when I installed it, it made my pc very slower than when I use initscripts so I gave it up and swtiched back to initscripts. Even if those files may not matter since I use initscripts, here are the files:

"/etc/adjtime"

0.000000 1345479900 0.000000
1345479900
UTC

"/etc/timezone"

0.000000 1345479900 0.000000
1345479900
UTC

I live in Canada, Québec, so I guess timezone should be "Canada/Eastern". As I was reading some post, at a certain point, someone said to delete the link /etc/localtime. I didn't recreated it. I'll do it right now.

Offline

#4 2012-08-20 19:17:38

sim590
Member
Registered: 2012-07-22
Posts: 31

Re: [SOLVED] Hardware and system clock problem

sorry,

"/etc/timezone" is

Canada/Eastern

Offline

#5 2012-08-20 19:55:54

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SOLVED] Hardware and system clock problem

sim590 wrote:

Time displayed in gnome (I use gnome GUI) and from the output of "date" are wrong.

Install chrony - that seems to be the best (others are ntpd and openntpd).

the time on windows (which is on another partition on the same disk) is wrong too.

You have to sync Arch & Windows to use either UTC (best) or localtime.

Last edited by brebs (2012-08-20 20:09:52)

Offline

#6 2012-08-20 20:20:51

Terminator
Member
From: Belgium
Registered: 2012-05-07
Posts: 265

Re: [SOLVED] Hardware and system clock problem

/etc/adjtime is wrong if you want to use localtime.

It should contain:

0.0 0.0 0.0
0
LOCAL

See https://wiki.archlinux.org/index.php/Sy … clock_time

edit: I guess this shouldn't matter since you are not using systemd anymore.

Last edited by Terminator (2012-08-20 20:22:30)

Offline

#7 2012-08-20 20:32:37

sim590
Member
Registered: 2012-07-22
Posts: 31

Re: [SOLVED] Hardware and system clock problem

Well, it's good you tell me anyway. I'll switch for systemd as soon as I understand it and if I discover how to make it run without making my pc extremly lag for no reason.

EDIT: I guess it matters! I changed it to what you said and now it says it's 19:36 when supposed to be 16:36!

Output of "date"

lun aoû 20 19:36:55 EDT 2012

Output of "hwclock --debug"

hwclock de util-linux 2.21.2
Utilisant /dev interface to clock.
Le dernier ajustement de dérive a été fait 0 secondes après 1969
La dernière calibration a été faite 0 secondes après 1969
L'horloge matérielle fonctionne selon le temps locale
On assume que l'horloge matérielle est conservée dans le temps de locale.
En attente d'un tic d'horloge…
… a obtenu un tic d'horloge
Heure lue de l'horloge matérielle : 2012/08/20 19:37:50
Heure de l'horloge matérielle : 2012/08/20 19:37:50 = 1345505870 secondes depuis 1969
lun 20 aoû 2012 19:37:50 EDT  -0.244808 secondes

Last edited by sim590 (2012-08-20 20:38:59)

Offline

#8 2012-08-20 20:40:16

sim590
Member
Registered: 2012-07-22
Posts: 31

Re: [SOLVED] Hardware and system clock problem

brebs wrote:
sim590 wrote:

Time displayed in gnome (I use gnome GUI) and from the output of "date" are wrong.

Install chrony - that seems to be the best (others are ntpd and openntpd).

the time on windows (which is on another partition on the same disk) is wrong too.

You have to sync Arch & Windows to use either UTC (best) or localtime.


Ok, i'll try that and give you some news!

EDIT: But why do I have to install software in addition to the arch system to get the date to work? It sounds like if arch wasn't enough or that the software you tell me to install is more like a bandaid than a solution.

Last edited by sim590 (2012-08-20 20:51:52)

Offline

#9 2012-08-20 21:37:58

sim590
Member
Registered: 2012-07-22
Posts: 31

Re: [SOLVED] Hardware and system clock problem

Another thing: gnome's date and time configuration panel says im in Europe/London. It might help..

Offline

#10 2012-08-20 21:42:54

Zancarius
Member
From: NM, USA
Registered: 2012-05-06
Posts: 207

Re: [SOLVED] Hardware and system clock problem

sim590 wrote:

Another thing: gnome's date and time configuration panel says im in Europe/London. It might help..

What's the output of

strings /etc/localtime

He who has no .plan has small finger.
~Confucius on UNIX.

Offline

#11 2012-08-20 21:44:03

sim590
Member
Registered: 2012-07-22
Posts: 31

Re: [SOLVED] Hardware and system clock problem

Zancarius wrote:
sim590 wrote:

Another thing: gnome's date and time configuration panel says im in Europe/London. It might help..

What's the output of

strings /etc/localtime

It's:

TZif2
6`/~Kp0
`1gg
`3GI
`5'+
pCda`D/vpEDC`E
@`M|kpN
"`O\MpP
`Q</pRu
k`b-
pcgM`d
xpeG/`e
Zpg'
<`|~gp}
`~^Ip
TZif2
/~Kp
Cda`
D/vp
EDC`
M|kp
O\Mp
Q</p
cgM`
eG/`
|~gp
~^Ip
EST5EDT,M3.2.0,M11.1.0

Offline

#12 2012-08-20 21:47:42

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: [SOLVED] Hardware and system clock problem

And what is the output of

ls -l /etc/localtime

Offline

#13 2012-08-20 21:51:35

sim590
Member
Registered: 2012-07-22
Posts: 31

Re: [SOLVED] Hardware and system clock problem

2ManyDogs wrote:

And what is the output of

ls -l /etc/localtime

It's

lrwxrwxrwx 1 root root 34 20 aoû 14:19 /etc/localtime -> /usr/share/zoneinfo/Canada/Eastern

Offline

#14 2012-08-21 04:14:25

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

Re: [SOLVED] Hardware and system clock problem

sim590 wrote:

(I use french system, sorry big_smile)

Don't be.

But you can do this:

LC_ALL=C hwclock --debug

smile


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

#15 2012-08-21 04:28:35

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

Re: [SOLVED] Hardware and system clock problem

How many hours are you behind UTC?  I would have thought four, but are you only three?

This does not look good:

On assume que l'horloge matérielle est conservée dans le temps de locale.

 
I don't speak French, but I've a hunch that is telling me that your system assumes the hardware clock is set to local time.

Are you using systemd instead of initscripts?  If you don't know, it is initscripts smile
If initscripts , make certain that you have the line HARDWARECLOCK="UTC" in your /etc/rc.conf.

Also, the more I look, ignore my first question.  Your hardware clock is set one hour behind UTC.  We can fix that later.


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

#16 2012-08-21 11:42:40

sim590
Member
Registered: 2012-07-22
Posts: 31

Re: [SOLVED] Hardware and system clock problem

ewaller wrote:

How many hours are you behind UTC?  I would have thought four, but are you only three?

This does not look good:

On assume que l'horloge matérielle est conservée dans le temps de locale.

 
I don't speak French, but I've a hunch that is telling me that your system assumes the hardware clock is set to local time.

Are you using systemd instead of initscripts?  If you don't know, it is initscripts smile
If initscripts , make certain that you have the line HARDWARECLOCK="UTC" in your /etc/rc.conf.

Also, the more I look, ignore my first question.  Your hardware clock is set one hour behind UTC.  We can fix that later.

Ok, I have fixed the file /etc/rc.conf by adding this line

HARDWARECLOCK="UTC"

Then, when I rebooted, I saw a red message telling: /etc/rc.conf says RTC is UTC, but /etc/adjtime says it's localtime. So I figured (easily, big_smile) that those two files confront each other. Since I use initscripts, I should delete /etc/adjtime, should I?

Plus, after the reboot, when I logged back in, I noticed the date changed from REALTIME + 3hours to REALTIME - 1hours.

Offline

#17 2012-08-21 13:20:49

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

Re: [SOLVED] Hardware and system clock problem

sim590 wrote:

]Since I use initscripts, I should delete /etc/adjtime, should I?

Yes.  Then reboot.
Then let us look at the output of hwclock --debug again.


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

#18 2012-08-21 14:05:27

sim590
Member
Registered: 2012-07-22
Posts: 31

Re: [SOLVED] Hardware and system clock problem

ewaller wrote:
sim590 wrote:

]Since I use initscripts, I should delete /etc/adjtime, should I?

Yes.  Then reboot.
Then let us look at the output of hwclock --debug again.

I moved /etc/adjtime to /etc/adjtime.backup. Here is the new output of "LC_ALL=C hwclock --debug":

hwclock from util-linux 2.21.2
Using /dev interface to clock.
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2012/08/21 13:01:18
Hw clock time : 2012/08/21 13:01:18 = 1345554078 seconds since 1969
Tue Aug 21 09:01:18 2012  -0.812997 seconds

EDIT: Time should be 10:01 by the way!

Last edited by sim590 (2012-08-21 14:06:13)

Offline

#19 2012-08-21 14:06:56

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: [SOLVED] Hardware and system clock problem

Are you dualbooting some silly OS that doesn't support having the hwclock as utc?

If not, just run ntpd -qg, check the time, if correct, hwclock -uw


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#20 2012-08-21 14:23:37

sim590
Member
Registered: 2012-07-22
Posts: 31

Re: [SOLVED] Hardware and system clock problem

Mr.Elendig wrote:

Are you dualbooting some silly OS that doesn't support having the hwclock as utc?

If not, just run ntpd -qg, check the time, if correct, hwclock -uw

The only OS's installed on my computer are Arch Linux and Windows. Again, if I understand well this, installing a software onto Arch to get the time right sounds more like a patch than a solution. I'd like to solve the problem by configuring the right way. But, could

hw clock -uw

solve my problem?

Offline

#21 2012-08-21 16:03:11

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SOLVED] Hardware and system clock problem

sim590 wrote:

Time should be 10:01 by the way!

So set it. "man date" shows you how.

Then set the *hardware* clock with:

hwclock -s -u

Notice that there's no random space in "hwclock"?

Then install Chrony, to not have to bother with this again, as I mentioned.

Then reboot into and configure Windows to use UTC, as I mentioned.

The first time this is all done, it's confusing because one gets all the UTC/localtime/timezone mixups.

Offline

#22 2012-08-21 17:23:49

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

Re: [SOLVED] Hardware and system clock problem

sim590 wrote:

I moved /etc/adjtime to /etc/adjtime.backup. Here is the new output of "LC_ALL=C hwclock --debug":

hwclock from util-linux 2.21.2
Using /dev interface to clock.
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2012/08/21 13:01:18
Hw clock time : 2012/08/21 13:01:18 = 1345554078 seconds since 1969
Tue Aug 21 09:01:18 2012  -0.812997 seconds

EDIT: Time should be 10:01 by the way!

But notice what time your system thinks UTC is.  That is wrong.  it should have been 14:01.  It is off by an hour.  Lets fix that.

Set the kernel time using the date command. sudo date -s "hh:mm"  where hh is in 24 hour format (local time) and mm are the minutes.
Check that it is correct with date

Now, the kernel knows the local time, and the UTC; but the hardware (BIOS) clock does not; it is still off by an hour.
Do a hwclock --systohc  which will push the kernel (System) time into the BIOS clock.

Reboot, and see if all is well

Edit: Sorry brebs.  I did not read your post.  We said the same thing (basically).  I prefer ntpd.  Vive la différence
Edit: Added quotes in date command

Last edited by ewaller (2012-08-21 17:29:03)


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

#23 2012-08-21 20:09:03

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SOLVED] Hardware and system clock problem

ewaller wrote:

I prefer ntpd.

So did I, until earlier this month. Now I've switched to chrony - here's some reasons.

Offline

#24 2012-08-21 20:48:39

sim590
Member
Registered: 2012-07-22
Posts: 31

Re: [SOLVED] Hardware and system clock problem

The commands you guys told me to run fixed the problem! big_smile And if I understand well, all I gotta do is install one of those software and no further configuration is needed in order for Windows to not mess everything up?

Offline

#25 2012-08-21 21:29:12

Zancarius
Member
From: NM, USA
Registered: 2012-05-06
Posts: 207

Re: [SOLVED] Hardware and system clock problem

sim590 wrote:

The commands you guys told me to run fixed the problem! big_smile And if I understand well, all I gotta do is install one of those software and no further configuration is needed in order for Windows to not mess everything up?

Mostly. smile

If you're running Windows and therefore have your hardware clock set to local time instead of UTC (and left Windows at its default configuration), there's a strong possibility that your clock can get changed twice if you live in a timezone that recognizes DST--once under Arch, once under Windows. It's an easy enough fix, but it's worth being aware of lest you be surprised!


He who has no .plan has small finger.
~Confucius on UNIX.

Offline

Board footer

Powered by FluxBB