You are not logged in.

#1 2014-12-17 17:25:23

Kristofer
Member
Registered: 2014-10-28
Posts: 23

[SOLVED]wrong time on clock

morning everyone just finished my second install of Arch linux with XFCE on an old netbook (Asus Eeepc 901) and my clock is displaying the wrong time. I already checked the BIOS to make sure the hardware clock is correct and it is, it also appear's my UTC is correct as well. Here is a my output of hwclock --debug:

hwclock from util-linux 2.25.2
Using the /dev interface to the clock.
Last drift adjustment done at 1418769271 seconds after 1969
Last calibration done at 1418769271 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/12/17 09:03:02
Hw clock time : 2014/12/17 09:03:02 = 1418806982 seconds since 1969
Wed 17 Dec 2014 01:03:02 AM PST  -0.470354 seconds

Last edited by Kristofer (2014-12-17 19:33:42)

Offline

#2 2014-12-17 17:31:53

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

Re: [SOLVED]wrong time on clock

What do you mean that the BIOS clock is correct?
You posted this at 9:25 PST.  Your hardware clock says that it is 9:03.  I'm guessing you did that about 22 minutes before you posted.  I am guessing you are on the West Cost of North America (confirmed now that I see your time zone is PST)

If So, your hardware clock is not set to UTC Time, it is set to local time.  UTC is 8 hours ahead of you.

look at the output of timedatectl, it will tell you volumes.


Edit: Fixed my reversed logic hmm

Last edited by ewaller (2014-12-17 17:35:22)


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

#3 2014-12-17 17:50:45

Kristofer
Member
Registered: 2014-10-28
Posts: 23

Re: [SOLVED]wrong time on clock

ya I did run debug before I wrote the post...So how can I fix this sorry I'm still figuring things out when it comes to ARch

Offline

#4 2014-12-17 18:09:50

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

Re: [SOLVED]wrong time on clock

Set you hw clock to UTC.

Offline

#5 2014-12-17 18:15:57

Kristofer
Member
Registered: 2014-10-28
Posts: 23

Re: [SOLVED]wrong time on clock

ran "sudo hwclock --systohc --utc" and nothing changed do I need to reboot?

Offline

#6 2014-12-17 18:19:14

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

Re: [SOLVED]wrong time on clock

At issue is a company in the Pacific Northwest that had an operating system that was never designed to be hooked to the global Internet.  They thought that it would be better if all of these personal computers scattered and isolated around the world were aware of the local time.  More robust operating systems set the hardware clock to Universal Coordinated Time (which is pretty close to Greenwich Mean Time).  Then, each computer can calculate what is the local time based upon the season and geolocation. 

No doubt your computer had an operating system that naively depended on the hardware clock being set to local time.  The problem is, when the computer moves, you have to change the datum.  When you do that, how do you figure out the relative ages of files on the file system, or of events in the logs?    Yuck.  Anyway, you have exorcised inferior operating systems from your system, so change your clock to UTC and enjoy your modern environment.  You may want to turn on NTP as well -- it ensures your clock is always correct.


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

#7 2014-12-17 18:21:43

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

Re: [SOLVED]wrong time on clock

Kristofer wrote:

ran "sudo hwclock --systohc --utc" and nothing changed do I need to reboot?

SET YOUR HARDWARE CLOCK TO WHAT THIS SITE SAYS.





sorry -- I just felt like yelling tongue

Edit:  Okay, that command you gave won't do it.  The system already thought the time was kept in UTC.  date probably indicates the time is about 2:30.  Pushing that time to the hardware clock won't help.
The command you gave might work if you use date to set the time to your local time, then do that hwclock command.  It would be easier just to set it directly.


Edit2:  Can I suggest just turning on NTP?  timedatectl set-ntp true

Last edited by ewaller (2014-12-17 18:36:48)


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-12-17 18:39:28

Kristofer
Member
Registered: 2014-10-28
Posts: 23

Re: [SOLVED]wrong time on clock

ewaller wrote:
Kristofer wrote:

ran "sudo hwclock --systohc --utc" and nothing changed do I need to reboot?

SET YOUR HARDWARE CLOCK TO WHAT THIS SITE SAYS.





sorry -- I just felt like yelling tongue

Edit:  Okay, that command you gave won't do it.  The system already thought the time was kept in UTC.  date probably indicates the time is about 2:30.  Pushing that time to the hardware clock won't help.
The command you gave might work if you use date to set the time to your local time, then do that hwclock command.  It would be easier just to set it directly.


Edit2:  Can I suggest just turning on NTP?  timedatectl set-ntp true

thank you sir I had to set my hardware clock directly in the BIOS to 18:41 using the site you linked

I need to install NTP first yes to enable it? would that be better?

Last edited by Kristofer (2014-12-17 18:40:49)

Offline

#9 2014-12-17 18:56:02

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

Re: [SOLVED]wrong time on clock

thank you sir I had to set my hardware clock directly in the BIOS to 18:41 using the site you linked

Cool smile

I need to install NTP first yes to enable it? would that be better?

You know, I am not sure hmm  I had it installed and running as a service, then I changed over to using systemd to start it.  I only require that my machine be an NTP client, not a server.   I don't think it needs to be installed.   <ewaller logs into his box at home ----->  I just checked, and it is not installed.  So I think you can just enable it in systemd if all you need is to be a client.

~ $ pacman -Qs ntp
local/presentproto 1.0-1
    X11 Present protocol specification
local/printproto 1.0.5-3
    X11 print extension wire protocol
~ $ timedatectl
      Local time: Wed 2014-12-17 10:55:24 PST
  Universal time: Wed 2014-12-17 18:55:24 UTC
        RTC time: Wed 2014-12-17 18:55:24
       Time zone: US/Pacific (PST, -0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sun 2014-11-02 01:59:59 PDT
                  Sun 2014-11-02 01:00:00 PST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2015-03-08 01:59:59 PST
                  Sun 2015-03-08 03:00:00 PDT
~ $

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

#10 2014-12-17 19:10:30

Kristofer
Member
Registered: 2014-10-28
Posts: 23

Re: [SOLVED]wrong time on clock

ewaller wrote:

thank you sir I had to set my hardware clock directly in the BIOS to 18:41 using the site you linked

Cool smile

I need to install NTP first yes to enable it? would that be better?

You know, I am not sure hmm  I had it installed and running as a service, then I changed over to using systemd to start it.  I only require that my machine be an NTP client, not a server.   I don't think it needs to be installed.   <ewaller logs into his box at home ----->  I just checked, and it is not installed.  So I think you can just enable it in systemd if all you need is to be a client.

~ $ pacman -Qs ntp
local/presentproto 1.0-1
    X11 Present protocol specification
local/printproto 1.0.5-3
    X11 print extension wire protocol
~ $ timedatectl
      Local time: Wed 2014-12-17 10:55:24 PST
  Universal time: Wed 2014-12-17 18:55:24 UTC
        RTC time: Wed 2014-12-17 18:55:24
       Time zone: US/Pacific (PST, -0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sun 2014-11-02 01:59:59 PDT
                  Sun 2014-11-02 01:00:00 PST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2015-03-08 01:59:59 PST
                  Sun 2015-03-08 03:00:00 PDT
~ $

well here's my output

 
     Local time: Wed 2014-12-17 11:08:11 PST
  Universal time: Wed 2014-12-17 19:08:11 UTC
        RTC time: Wed 2014-12-17 19:08:10
       Time zone: America/Los_Angeles (PST, -0800)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  Sun 2014-11-02 01:59:59 PDT
                  Sun 2014-11-02 01:00:00 PST
 Next DST change: DST begins (the clock jumps one hour forward) at
                  Sun 2015-03-08 01:59:59 PST
                  Sun 2015-03-08 03:00:00 PDT

and it isn't enabled.

Offline

#11 2014-12-17 19:32:58

Kristofer
Member
Registered: 2014-10-28
Posts: 23

Re: [SOLVED]wrong time on clock

Eh I'll just be happy with changing the actual bios clock to UTC time thanks for the help guys

Offline

#12 2014-12-17 19:48:56

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: [SOLVED]wrong time on clock

You don't need to install anything extra if you just want to use an NTP client.
To repeat what ewaller posted in post #7 (you may have missed it):

timedatectl set-ntp true

See also the systemd-timesyncd wiki page https://wiki.archlinux.org/index.php/Systemd-timesyncd

Offline

Board footer

Powered by FluxBB