You are not logged in.

#1 2019-03-29 16:11:20

bugsmanagement
Member
Registered: 2017-04-21
Posts: 201

[solved]Why 'hwclock --show --utc' differet from 'timedatectl'?

timedatectl                                                                                                                                                                                                                   
                      Local time: Fri 2019-03-29 12:01:02 EDT
                  Universal time: Fri 2019-03-29 16:01:02 UTC
                        RTC time: Fri 2019-03-29 12:00:53
                       Time zone: America/New_York (EDT, -0400)
       System clock synchronized: no
systemd-timesyncd.service active: no
                 RTC in local TZ: no
# hwclock --show --utc
2019-03-29 08:03:27.764816-0400

man hwclock

-r, --show
       --get

Read the Hardware Clock and print its time to standard output in the ISO 8601 format.  The time shown is always in local time, even if you keep your Hardware Clock in UTC

Hello everyone,

I'm am bit confused here, why is the RTC time from timedatactl is off from the output of hwclock? The problem here is often time would be off 2+ hours either way on reboot, presumably when I executed 'hwclock --systohc', the hardware clock would have been set correctly yes? I find that only after I manually set the clock in BIOS/CMOS, did the time finally retained, am I missing something here?

Cheers

Last edited by bugsmanagement (2019-03-29 17:06:12)

Offline

#2 2019-03-29 16:21:24

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,523

Re: [solved]Why 'hwclock --show --utc' differet from 'timedatectl'?

The RTC is at 12:00 and considered to be UTC (so 08:00 EDT)
Since you're posting this ~16:00 UTC this means the RTC is in fact kept in local time and wrongly assumed as UTC.
You can either set the RTC to the accurate UTC or make the system aware of the RCT condition, https://wiki.archlinux.org/index.php/Sy … e_standard

Ensure there's no hibernating windows (and windows now hibernates by default on shutdown)

Offline

#3 2019-03-29 16:37:46

bugsmanagement
Member
Registered: 2017-04-21
Posts: 201

Re: [solved]Why 'hwclock --show --utc' differet from 'timedatectl'?

seth wrote:

Since you're posting this ~16:00 UTC this means the RTC is in fact kept in local time and wrongly assumed as UTC.

RTC time: Fri 2019-03-29 12:00:53

Ahh, yes, it didn't dong on me till now.

seth wrote:

Ensure there's no hibernating windows (and windows now hibernates by default on shutdown)

That was done long ago.

seth wrote:

The RTC is at 12:00 and considered to be UTC (so 08:00 EDT)

# hwclock --show --utc
2019-03-29 08:03:27.764816-0400

This is where I'm confused at,
https://www.timeanddate.com/worldclock/ … 000&p1=198

UTC should be at 16:00 ?

EDIT:

Will look into this next time I boot into windows.
https://wiki.archlinux.org/index.php/Sy … in_Windows

Last edited by bugsmanagement (2019-03-29 16:44:03)

Offline

#4 2019-03-29 16:49:15

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [solved]Why 'hwclock --show --utc' differet from 'timedatectl'?

bugsmanagement wrote:
seth wrote:

Ensure there's no hibernating windows (and windows now hibernates by default on shutdown)

That was done long ago.

When was the last time you checked? Windows has a habit of reverting this setting when it upgrades.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2019-03-29 16:54:48

bugsmanagement
Member
Registered: 2017-04-21
Posts: 201

Re: [solved]Why 'hwclock --show --utc' differet from 'timedatectl'?

About month and half ago, when Windows NTFS partition was mounted in ro. Will double check on it once I boot back into it. Reading the wiki explains why the clock there was always skewed in WIndows and while I"m at it, disable time synchronization.

Offline

#6 2019-03-29 17:01:13

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,523

Re: [solved]Why 'hwclock --show --utc' differet from 'timedatectl'?

bugsmanagement wrote:
# hwclock --show --utc
2019-03-29 08:03:27.764816-0400

This is where I'm confused at,

hwclock *always* prints in localtime, "--utc" tells it to consider the RTC in UTC (the default anyway, depending on adjtime settings)
The output means it's 8:03 in NY, 4h behind UTC (12:03)
The problem is that in reality it was 12:03 in NY and 16:03 UTC - the cause is that the RTC is "off" (for so far unknown reasons set to 12:03, ie. in localtime)

Offline

#7 2019-03-29 17:08:21

bugsmanagement
Member
Registered: 2017-04-21
Posts: 201

Re: [solved]Why 'hwclock --show --utc' differet from 'timedatectl'?

seth wrote:

hwclock *always* prints in localtime, "--utc" tells it to consider the RTC in UTC (the default anyway, depending on adjtime settings)
The output means it's 8:03 in NY, 4h behind UTC (12:03)
The problem is that in reality it was 12:03 in NY and 16:03 UTC - the cause is that the RTC is "off" (for so far unknown reasons set to 12:03, ie. in localtime)

Thanks, I'll over muddle of this. Appreciate everyone's help.

Cheers

Last edited by bugsmanagement (2019-03-29 17:08:44)

Offline

Board footer

Powered by FluxBB