You are not logged in.

#1 2014-05-26 11:29:02

yotama9
Member
Registered: 2010-10-06
Posts: 70

Time zone set correct, hwclock set correct, locale time is wrong

I've probably messed something up with my games. I just installed arch and played with various wm/de. I am now using xfce4. To my knowledge, the system clock was always wrong. This post describes a condition similar to mine. However, upon

sudo ntpd -qg

followed by reboot I get this condition

[root@moving y2]# hwclock --debug
hwclock from util-linux 2.24.1
Using /dev interface to clock.
Last drift adjustment done at 1400957329 seconds after 1969
Last calibration done at 1400957329 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: 2014/05/26 14:21:00
Hw clock time : 2014/05/26 14:21:00 = 1401114060 seconds since 1969
Mon 26 May 2014 05:21:00 PM IDT  -0.829235 seconds
[root@moving y2]# timedatectl 
      Local time: Mon 2014-05-26 17:21:08 IDT
  Universal time: Mon 2014-05-26 14:21:08 UTC
        RTC time: Mon 2014-05-26 14:21:08
       Time zone: Israel (IDT, +0300)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Fri 2014-03-28 01:59:59 IST
                  Fri 2014-03-28 03:00:00 IDT
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2014-10-26 01:59:59 IDT
                  Sun 2014-10-26 01:00:00 IST

So, the HW clock i right, but the universal clock is wrong.

How can I fix this?

Edit: Sorry, this is the other way around.

Hwclock is wrong and the universal time is what should be the local time.

Last edited by yotama9 (2014-05-26 11:53:42)

Offline

#2 2014-05-26 11:45:26

the_shiver
Member
Registered: 2013-03-27
Posts: 130

Re: Time zone set correct, hwclock set correct, locale time is wrong

set your hw clock to the correct utc time (http://www.worldtimeserver.com/current_time_in_UTC.aspx)

Offline

#3 2014-05-26 11:54:35

yotama9
Member
Registered: 2010-10-06
Posts: 70

Re: Time zone set correct, hwclock set correct, locale time is wrong

the_shiver, Sorry, I was wrong previously, the hwclock is wrong, what the machine think is the universal time is actually the local time. Is your answer still valid?

Last edited by yotama9 (2014-05-26 11:54:56)

Offline

#4 2014-05-26 14:31:47

the_shiver
Member
Registered: 2013-03-27
Posts: 130

Re: Time zone set correct, hwclock set correct, locale time is wrong

yes

Offline

#5 2014-05-26 16:32:33

\hbar
Member
Registered: 2014-03-15
Posts: 165

Re: Time zone set correct, hwclock set correct, locale time is wrong

I don't understand: your hw clock is set to UTC and shows 14:21:00, the universal time (i.e. UTC) shows 14:21:08, and your local time shows 17:21:08, which corresponds to the time zone +0300.

So what's the problem?

Offline

#6 2014-05-26 16:34:53

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: Time zone set correct, hwclock set correct, locale time is wrong

The problem is that he doesn't understand what UTC is.

Last edited by Scimmia (2014-05-26 17:23:01)

Offline

#7 2014-05-26 17:20:40

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

Re: Time zone set correct, hwclock set correct, locale time is wrong

\hbar wrote:

So what's the problem?

He posted at 04:29 PDT.  That is 11:29 UTC.  At that time, his HW clock said 14:29 (I am adding the 8 minutes it took him to post).  That made his local time reported by his system to be 17:29.

It is pretty clear his hardware clock (which is supposed to be set to UTC) is set to UTC+3


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 2014-05-26 17:24:28

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

Re: Time zone set correct, hwclock set correct, locale time is wrong

The ntpd command you used will only set the system clock, it will not sync the hardware clock with this setting, you need an additional command for that `hwclock -w`.  I use an alias in my bashrc (to get the network time pretty darn quick wink):

alias ntpdq='sudo ntpd -q && sudo hwclock -w'

Also, if you are dual booting with windows, you'll need to check the wiki on how to prevent windows from resetting the clock to local time.

Last edited by Trilby (2014-05-26 17:26:13)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2014-05-26 17:38:51

yotama9
Member
Registered: 2010-10-06
Posts: 70

Re: Time zone set correct, hwclock set correct, locale time is wrong

ewaller: you are correct.

the shiver: I didn't find how to set hwclock. I set the system clock using timedatectl, and it updated the hwclock

I tried to set my system clock manually, the time now is roughly correct, will see how things. Go.

Offline

#10 2014-05-26 17:58:22

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Time zone set correct, hwclock set correct, locale time is wrong

Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2014-05-26 18:55:58

the_shiver
Member
Registered: 2013-03-27
Posts: 130

Re: Time zone set correct, hwclock set correct, locale time is wrong

yotama9 wrote:

the shiver: I didn't find how to set hwclock. I set the system clock using timedatectl, and it updated the hwclock

what trilby said or do it via your bios/firmware

Offline

Board footer

Powered by FluxBB