You are not logged in.

#1 2013-07-27 06:44:13

klaus
Member
From: Brazil
Registered: 2013-03-09
Posts: 42

[SOLVED] Yet another UTC clock issue

Hello,

I already searched the forums for a solution but I got nothing, and I'm kind of confused about what's going on here.
My clock was synced with `ntpd -q` and I issued a `hwclock -wu` as follow up, but my clock still shows the wrong time.

I'm gonna paste the output of a few commands to explain myself better.

Right now, it's 03:38am here, which is the time shown as Universal Time in timedatectl.

[klaus@void ~]$ timedatectl status
      Local time: Sat 2013-07-27 00:38:29 BRT
  Universal time: Sat 2013-07-27 03:38:29 UTC
        Timezone: America/Sao_Paulo (BRT, -0300)
     NTP enabled: no
NTP synchronized: yes
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sat 2013-02-16 23:59:59 BRST
                  Sat 2013-02-16 23:00:00 BRT
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sat 2013-10-19 23:59:59 BRT
                  Sun 2013-10-20 01:00:00 BRST

My hardware clock shows the same result.

[klaus@void ~]$ sudo hwclock --debug
hwclock from util-linux 2.23.1
Using /dev interface to clock.
Last drift adjustment done at 1374896016 seconds after 1969
Last calibration done at 1374896016 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: 2013/07/27 03:40:09
Hw clock time : 2013/07/27 03:40:09 = 1374896409 seconds since 1969
Sat 27 Jul 2013 12:40:09 AM BRT  -0.219445 seconds

The clock in my tint2 panel shows 12:40am, and I get that subtracting 3 hours from my timezone that would be right, but it isn't.
How do I fix this and is my interpretation of UTC wrong? I mean, wasn't it supposed to show the right time?

Thanks in advance,

Last edited by klaus (2013-07-27 07:27:10)

Offline

#2 2013-07-27 07:05:59

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

Re: [SOLVED] Yet another UTC clock issue

Your hardware clock is set to your local time. The system thinks the hardware clock is set to UTC (the local time in Greenwich England), so it subtracts 3 hours from the hardware clock and shows you what it thinks is local time, but it's wrong.

If you do not dual boot with Windows, simply set your hardware clock to the correct UTC time using

# timedatectl set-time "2012-10-30 18:17:16"

where the string in quotes is the correct UTC time (your local time plus three hours).

Windows expects the hardware clock to be set to local time, so if you dual boot you will need to either adjust Arch to work with a local-time hardware clock, or adjust Windows to work with a UTC clock. See this topic: https://wiki.archlinux.org/index.php/Ti … in_Windows

Last edited by 2ManyDogs (2013-07-27 07:09:06)

Offline

#3 2013-07-27 07:15:37

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Yet another UTC clock issue

You probably need to first do "ntpd -qg" which allows the first time shift to be large if the time is over a certain amount off. Of course that first time sync will be the only sync because the -q makes it quite right away.

Offline

#4 2013-07-27 07:16:34

klaus
Member
From: Brazil
Registered: 2013-03-09
Posts: 42

Re: [SOLVED] Yet another UTC clock issue

2ManyDogs wrote:

Your hardware clock is set to your local time. The system thinks the hardware clock is set to UTC (the local time in Greenwich England), so it subtracts 3 hours from the hardware clock and shows you what it thinks is local time, but it's wrong.

If you do not dual boot with Windows, simply set your hardware clock to the correct UTC time using

# timedatectl set-time "2012-10-30 18:17:16"

where the string in quotes is the correct UTC time (your local time plus three hours).

Windows expects the hardware clock to be set to local time, so if you dual boot you will need to either adjust Arch to work with a local-time hardware clock, or adjust Windows to work with a UTC clock. See this topic: https://wiki.archlinux.org/index.php/Ti … in_Windows

Oh, now I got it! But still, do I really have to input the time manually with timedatectl or is there a way I can do it with NTP?
I dual boot Windows but I already made Windows' UTC and disabled its sync functionality, yesterday I reinstalled Arch after a while messing with Wheezy and somehow I can't seem to figure out how to fix this.

Edit: It seems like the -q flag did the trick, thanks WonderWoofy and 2ManyDogs!

Last edited by klaus (2013-07-27 07:19:33)

Offline

#5 2013-07-27 07:26:46

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

Re: [SOLVED] Yet another UTC clock issue

Please don't forget to edit your first post and add [SOLVED] to the beginning of the thread title....

And Welcome to the Arch Linux forums 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

#6 2013-07-27 07:28:37

klaus
Member
From: Brazil
Registered: 2013-03-09
Posts: 42

Re: [SOLVED] Yet another UTC clock issue

ewaller wrote:

Please don't forget to edit your first post and add [SOLVED] to the beginning of the thread title....

And Welcome to the Arch Linux forums smile

I was going to but got distracted reading the wiki. Done, thanks!

Offline

#7 2013-07-27 07:33:52

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

Re: [SOLVED] Yet another UTC clock issue

klaus wrote:

I was going to but got distracted reading the wiki.

You're gonna fit in here just fine big_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

Board footer

Powered by FluxBB