You are not logged in.

#1 2011-11-06 13:49:22

toni
Member
Registered: 2011-10-15
Posts: 437

[SOLVED] Not showing correct hour

Hi All,

I often have problems with hour, it is not being shown correctly. Arch shows one hour more, that is, for example, it shows 15:00 when it should be 14:00.

So I have to do from terminal:

hwclock --localtime
hwclock --hctosys
cp /usr/share/zoneinfo/Europe/Madrid /etc/localtime

As hardware clock is correct, this set my system time to the correct one but when I reboot... hour gets +1 again (incorrect) and I have to do all the above commented again.

I think I have the correct configurartion done in my files. Below I put some important lines (not all) related to time zone in /etc/rc.conf:

LOCALE="es_ES.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="localtime"
TIMEZONE="Europe/Madrid"

Regards


PD.: Also, recently when hour was changed to +1 (in my case Europe/Spain for winter time), I observed my Arch was not changing automatically to the correct hour so I had to set it manually.

Last edited by toni (2011-11-06 16:31:21)

Offline

#2 2011-11-06 14:03:29

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Not showing correct hour

I've set HARDWARECLOCK="UTC" and I have no problems. DST switch was automatic, as expected.

Offline

#3 2011-11-06 14:34:22

HuckleSmothered
Member
Registered: 2010-03-25
Posts: 68

Re: [SOLVED] Not showing correct hour

I'll second that. I used to use localtime but had multiple problems. Once I switched to UTC it has been problem free.

Not /really/ a solution to the problem, but a great workaround I think. Have you found any other solutions?

Offline

#4 2011-11-06 15:31:52

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] Not showing correct hour

Your clock will not be adjusted automatically for DST if your hwclock is not set to use UTC.

Offline

#5 2011-11-06 15:52:51

toni
Member
Registered: 2011-10-15
Posts: 437

Re: [SOLVED] Not showing correct hour

Hi all again,

I have been doing several tests and what I have observed is that if I set the following:

1.- HARDWARECLOCK to HARDWARECLOCK="UTC" in /etc/rc.conf
2.- I set system time manually to the correct one.
3.- From terminal I do: hwclock --systohc to set hardware clock from system time.
4.- From terminal again: hwclock --utc to say hardware clock is now in UTC as hwclock --show is showing the correct hour for my country.

Now I reboot and it works, that is, hour is shown correctly. But... as I have dual boot (Windows XP and Arch Linux, despite I never use Windows - only in a few cases If I have to use Office because Libre Office is not compatible at all with Office documents since it does not shows documents as they are shown in Office)... when I boot to Windows I note that hour is set to one hour less than in Arch Linux.... so If from WIndows I set hour to the correct one... when I come back Arch LInux again I observe that the hour is incorrect again (one hour more +1). As far as I Know it is recommended to set  HARDWARECLOCK="localtime" if you use dual boot so this is the reason why I had set to localtime.

You are right UTC is better since clock is adjusted automatically for DST but I have this problem now so any ideas?

Regards.

Last edited by toni (2011-11-06 16:11:27)

Offline

#6 2011-11-06 15:54:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Not showing correct hour

Is your Windows using UTC? You can tell it to.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
     "RealTimeIsUniversal"=dword:00000001

Last edited by karol (2011-11-06 15:56:01)

Offline

#7 2011-11-06 16:30:47

toni
Member
Registered: 2011-10-15
Posts: 437

Re: [SOLVED] Not showing correct hour

karol wrote:

Is your Windows using UTC? You can tell it to.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
     "RealTimeIsUniversal"=dword:00000001

Windows was not set to use UTC so I have set it and it works in both OSes wink

So the solution has been to set both OSes to UTC.

Thanks very much!

Offline

Board footer

Powered by FluxBB