Archlinux wrong localtime

0

Here is datetimectl output, Why local time is not set to Universal time? And I have enable ntpd service. The local time should be Sun 2013-08-11 21:45:21 UTC.

     Local time:  Mon 2013-08-12 05:45:21 CST
  Universal time: Sun 2013-08-11 21:45:21 UTC
        RTC time: Sun 2013-08-11 21:45:21
        Timezone: Asia/Shanghai (CST, +0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

By the way , My pc is equiped with dual System(archlinux/win7).

jilen

Posted 2013-08-11T13:47:24.163

Reputation: 291

1It's hard to know what's wrong without knowing when those time stamps were taken. Can you provide what you expect local time to be? – user606723 – 2013-08-11T14:05:43.433

Everything seems ok: UTC Sunday 21h -> Local time (+8h) Monday 5h. What local time do you expect? – Nicolas – 2013-08-11T20:23:24.117

The UTC time is the right time in my time zone. – jilen – 2013-08-12T11:08:49.120

@Nicolas Do you mean the UTC time is not correctly? It should be 8 hours before? – jilen – 2013-08-12T11:12:38.447

@jilen I don't know if your UTC time is good or not (just compare on internet to be sure). I just want to say, as you choose the Asia/Shangai timezone your localtime will be equal to the UTC time +8H – Nicolas – 2013-08-12T11:18:54.897

@Nicolas OK, seems the utc time is not correctly. I misunderstood the UTC time, I just think it is the time of +8(Asia/Shanghai). – jilen – 2013-08-12T14:29:25.890

@user606723 my real local time was expected to be the UTC time display in the question description. – jilen – 2013-08-12T14:37:36.970

Answers

1

Windows always automatically set the BIOS/RTC time by localtime. Linux on the other hand have different approach, it always set the BIOS/RTC time to UTC.

To make arch-linux using localtime then type:

timedatectl set-local-rtc 1

or to revert to UTC,

timedatectl set-local-rtc 0

More info on Time - ArchWiki

affan

Posted 2013-08-11T13:47:24.163

Reputation: 34

0

First of all you have to be sure of your TimeZone. If it's well Asia/Shanghai, you will have a different of +8 hours between the UTC and your local time.
It's normal, UTC time means universal time: the same for everyone. Although local time is the time of your country/city and it depends where you live.
So, only the people who live near the Greenwich meridian (+0H) have the same UTC and local time.
In my understanding, your time system works well. You misunderstood what UTC and local time are.

Nicolas

Posted 2013-08-11T13:47:24.163

Reputation: 815