You are not logged in.

#1 2013-08-10 13:25:57

knowayhack
Member
From: UK
Registered: 2012-04-05
Posts: 22

[SOLVED] Yet another time issue...

Hi there,

I'm having some crazy, hair pulling, head banging UTC time issues on both my dual boot (Arch & Windows 8) desktop and single boot laptop.

I've been searching and following a mulitude of old threads and the official Wiki guide, however, I simply cannot get UTC time to stay correct between reboots. I've installed Arch a fair few times now, both before and after the switch to systemd and in dual and single boot setups and have never had time related issues like this before...

Here's a run down of the whole sorry story....

Fresh install - set time with hwclock --systohw utc as suggested in the beginners guide.

First boot - time an hour out - huh? cat /etc/adjtime and ls -l /etc/localtime - everything as it should be... UTC and symlink to /usr/share/zoneinfo/Europe/London. Nonetheless I duly follow the Time guide on the wiki, get to know timedatectl a bit, and soon after, time is set to be correct. Great.

Reboot. Time an hour out. Whaaaa??. Start googling, finding a plethora of bbs links to others with similar issues, decide to use NTP. Install, ntpd -qg. All good again. Time right. Phew...

Reboot. Nope. Arrrrgggghhhh. (Bare in mind - at this point I haven't even booted the Windows 8 disc, and I went through the exact same process on my Arch only laptop...)

More googling, thread reading. Find out that hwclock and ntp might be in conflict. Delete /etc/adjtime, reinstall tzdata, re-follow Time article to the letter and reenable NTP to start at boot.

Reboot - time is foward an hour yet again. Bang head repeatedly on desk. Then suddenly - 10 mins or so after boot - NTP kicks in, and time is magically goes back an hour to the correct time! Surely NTP should be doing this early in the boot process, not 10 minutes after? But OK, at least something is happening...

Next I dare to boot into Windows, and yup, time an hour out. Expected, but frustrating nonetheless. Add the registry tweak as suggested in the guide, and turn off the Windows time synchronisation. During which I noticed that Windows 8 time is set to UTC by default, not localtime, which is what the wiki says. Is this a Windows 8 thing?

I can't help thinking, that if this is the case, and the Wiki advise is written under the assumption that Windows time is always localtime, that perhaps this is the route of my problem....

Anyway, Windows time all good now, reboot Arch, time again wrong untill NTP finally kicks in - sigh. Reboot to Windows. Time an hour back. Gaaaahhhh - WTF?!! reset it to be correct. Try again. Same thing. Oops, forgot to mention that on each reboot, I check the BIOS clock, which remains persistently correct during the whole debarkle...

Ok, so I try without the registry hack and turn Windows sync back on. Still fucked. I try various combinations of the two, I try resetting Arch time over and over again. With NTP - late sync. With hwclock only, or both hwclock & NTP - totally fucked! Eventually, I give up on UTC in Arch, set it localtime, delete registry key, turn Windows time sync back on, and thus far all good......

TL;DR - couldn't get hwclock to set UTC time correctly across reboots. NTP worked (sort of), but after each reboot it would take ten minutes for the time to sync and the clock to move back an hour to the correct time. Localtime just works...

My question is - why is the wiki (and the timedatectl status output for that matter) - so adamant that we should use UTC? From what I can gather, as long as I boot Windows around the DST time. or manually move the clock forward or back an hour - all should be well, no? Or are there other issues that I may run into that I've missed? The thing I'm most concerned about is data corruption due to timestamp issues...

Also, why does the wiki repeatedly say that Windows uses localtime, when this doesn't appear to be the case in Eight? Does the wiki need updating or is Windows lying to me? I know which I'd put my money on ;-)

Finally can anyone explain why my time was always an hour forward after a reboot, even when the time was set correctly before, the BIOS showed the correct time, and NTP was in use?

Sorry for the crazy long posting, but this issue has been driving me totally batty!! Any light-shedding greatfully appreciated :-)

Last edited by knowayhack (2013-08-10 15:24:09)


There is no truth. There is no reality. There is no consistency. There are no absolute statements. I am very probably wrong.

Offline

#2 2013-08-10 13:32:54

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: [SOLVED] Yet another time issue...

Just to clarify, Windows time is, by default, always in UTClocaltime. The wiki advises you to add the registry tweak so that you can set it to localtimeUTC; that way it won't interfere with the clock on Linux.

Now to the crux of the problem, I'm betting that what's happening is that the hardware clock hasn't been synchronized with the system clock. Did you ever sync the two using `hwclock`?

All the best,

-HG

Last edited by HalosGhost (2013-08-10 13:59:58)

Offline

#3 2013-08-10 13:57:22

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [SOLVED] Yet another time issue...

HalosGhost wrote:

The wiki advises

What page? Because it should be the opposite, AIUI, for the hardware clock.

The continued use of local time in the RTC by Microsoft operating systems causes various problems

Offline

#4 2013-08-10 13:58:07

knowayhack
Member
From: UK
Registered: 2012-04-05
Posts: 22

Re: [SOLVED] Yet another time issue...

Ahhhhh - Ok, that makes much more sense, obviously I completely misunderstood the Windows stuff. Feeling more than slightly silly now...!

I ran the hwclock --systohc utc command during the install, but not again after... except with the --debug flag when I was trying to work out what on earth was going on. What do you  suggest I try, and in what order? Reinstall registry tweak, turn off Windows syncing, then boot into Arch and run hwclock --systohc utc?

Also, from the Wiki article I got the impression that timedatectl is the prefered way to deal with time post install, which I have run repeatedly during all this, specifically 'timedatectl set-local-rtc 0' and 'timedatectl set-time ...'

Btw, cheers for the exceedling prompt response :-)


There is no truth. There is no reality. There is no consistency. There are no absolute statements. I am very probably wrong.

Offline

#5 2013-08-10 13:58:59

HalosGhost
Forum Fellow
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 2,097
Website

Re: [SOLVED] Yet another time issue...

brebs wrote:

What page? Because it should be the opposite, AIUI, for the hardware clock.

You are so right. I got ahead of myself. It's been about a year and a half since I've even tried to dual-boot with Windows. Sorry for my rustiness.

All the best,

-HG

Offline

#6 2013-08-10 13:59:58

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

Re: [SOLVED] Yet another time issue...

Less commentary and more raw data would help.  Specifically output from `timedatectl` for example.

knowayhack wrote:

I check the BIOS clock, which remains persistently correct during the whole debarkle...

This is why I say "raw" data would be helpful.  You are giving us your interpretation - and almost all such problems are because someone interpreted some information incorrectly.  What does it mean the BIOS clock is "correct"?  Correct by what metric?  Does it match the clock on your wall or your wrist watch?  If it does, it is incorrect


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

Offline

#7 2013-08-10 14:03:18

knowayhack
Member
From: UK
Registered: 2012-04-05
Posts: 22

Re: [SOLVED] Yet another time issue...

Ok, I shall give UTC another whirl and report back with the data....
Bloody'ell you guys are quick on the ol' help front :-) Should've posted earlier!


There is no truth. There is no reality. There is no consistency. There are no absolute statements. I am very probably wrong.

Offline

#8 2013-08-10 14:15:38

knowayhack
Member
From: UK
Registered: 2012-04-05
Posts: 22

Re: [SOLVED] Yet another time issue...

Ok so I did:

timedatectl set-local-rtc 0

rebooted into Windows, time an hour forward... fixed it, reinstalled reg fix, turned off sync. Check BIOS clock was correct - rebooted Arch. Time also an hour forward, and here's some raw data:

toby@archy ~ > timedatectl status
      Local time: Sat 2013-08-10 16:10:11 BST
  Universal time: Sat 2013-08-10 15:10:11 UTC
        Timezone: Europe/London (BST, +0100)
     NTP enabled: n/a
NTP synchronized: no
RTC in local TZ: no
      DST active: yes
Last DST change: DST began at
                  Sun 2013-03-31 00:59:59 GMT
                  Sun 2013-03-31 02:00:00 BST
Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2013-10-27 01:59:59 BST
                  Sun 2013-10-27 01:00:00 GMT

toby@archy ~ > sudo hwclock --debug
hwclock from util-linux 2.23.2
Using /dev interface to clock.
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
...got clock tick
Time read from Hardware Clock: 2013/08/10 15:10:40
Hw clock time : 2013/08/10 15:10:40 = 1376147440 seconds since 1969
Sat 10 Aug 2013 16:10:40 BST  -0.406710 seconds

UTC is right, it say hwclock is UTC, which is 15:10.... yet my time is 16:10, aka - localtime.... WTF??!

Last edited by knowayhack (2013-08-10 14:28:21)


There is no truth. There is no reality. There is no consistency. There are no absolute statements. I am very probably wrong.

Offline

#9 2013-08-10 14:16:59

kaszak696
Member
Registered: 2009-05-26
Posts: 543

Re: [SOLVED] Yet another time issue...

As Trillby said, to make this whole ordeal work, your BIOS time has to be set to UTC time. It certainly doesn't help that Windows forcefully keeps BIOS time as localtime for stupid reasons, that's why your time always keeps being wrong. I don't have Windows 8, so i can't confirm this, but i read somewhere that RealTimeIsUniversal registry key is gone, but don't quote me on that.


'What can be asserted without evidence can also be dismissed without evidence.' - Christopher Hitchens
'There's no such thing as addiction, there's only things that you enjoy doing more than life.' - Doug Stanhope
GitHub Junkyard

Offline

#10 2013-08-10 14:21:27

knowayhack
Member
From: UK
Registered: 2012-04-05
Posts: 22

Re: [SOLVED] Yet another time issue...

Yeah your right - no RealTimeIsUniversal key in 8, but the documentation says to create it... Also, it's worth noting that I experienced the very similar issues on my single boot laptop install... Both of these install were done within the last week if that makes any difference...


There is no truth. There is no reality. There is no consistency. There are no absolute statements. I am very probably wrong.

Offline

#11 2013-08-10 14:27:47

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

Re: [SOLVED] Yet another time issue...

Trilby wrote:

What does it mean the BIOS clock is "correct"?  Correct by what metric?  Does it match the clock on your wall or your wrist watch?  If it does, it is incorrect

According to the output you provided (and my calculation based on the forum post time as you didn't say if it matched your wall clock) your hardware clock is incorrect.


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

Offline

#12 2013-08-10 14:33:09

knowayhack
Member
From: UK
Registered: 2012-04-05
Posts: 22

Re: [SOLVED] Yet another time issue...

Fuck me - I'm so confused! How can I correct my hardware clock? It's right in the BIOS - by wall clock, tablet and phone and Google....

Ooooooh - OK (I reallly need to read things more carefully!), so your saying my hardware clock needs to be "wrong" in relation to these things - DOH! This is why I hate asking for help - it always exposes my slow-witted idiocy!! Is it just me or is this not ridiculously counterintuitive?

So I take it, I should I set it back an hour in the BIOS?

Last edited by knowayhack (2013-08-10 14:38:20)


There is no truth. There is no reality. There is no consistency. There are no absolute statements. I am very probably wrong.

Offline

#13 2013-08-10 14:36:21

knowayhack
Member
From: UK
Registered: 2012-04-05
Posts: 22

Re: [SOLVED] Yet another time issue...

See, I assumed the OS changed and synced the BIOS clock, but I gather from what your saying the OS reads from the hardware clock and adjusts accordingly? So the BIOS clock never adjusts to DST?


There is no truth. There is no reality. There is no consistency. There are no absolute statements. I am very probably wrong.

Offline

#14 2013-08-10 14:46:12

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

Re: [SOLVED] Yet another time issue...

No, not if you set your systems to be in UTC.

I'm starting to wonder if people know what UTC stands for.  This is a *very* common problem.  In fact, I'd guess nearly every single time/clock issue stems from this misunderstanding.  UTC stands for Universal Time (or Coordinated Universal Time really).  There is only one Universal time in the whole ... well, planet not universe, so maybe it should be Planetary Time, but anyhow...

Universal time will match local time in only one time zone.  For everyone else, local time is some hour offset from Universal Time.  So if your hardware clock is in UTC, then your hardware clock should be some number of hours offset from your wallclock (assuming you set your wall clocks in local time).

If your hardware clock matches the clocks set to your local time zone, then your hardware clock is in local time (I really don't see how this confuses people, but experience shows that it really does).

EDIT: perhaps the confusion stems from the term Standard Time which is contrasted to any daylight saving or summer time adjustments.  Standard Time is the non-adjusted local time in any given time zone.  I guess I can see a confusion between Standard and Universal as names.  Universal time never gets summer/daylight saving adjustments.  There is one Universal Time on the planet, 24 Standard Times (I think, unless there was some 1/2 hour oddball timezone), and *many* local time variants depending on if and how the local authority adjusts for summer/daylight saving time.

Last edited by Trilby (2013-08-10 15:07:06)


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

Offline

#15 2013-08-10 14:48:49

knowayhack
Member
From: UK
Registered: 2012-04-05
Posts: 22

Re: [SOLVED] Yet another time issue...

Ok, so I set the clock back an hour in the BIOS, booted Windows - time right - YAY.

Rebooted Arch - time right. OMFG - pure joy!!!

I have to say, I still find it odd that this is how it works, and would like to confirm that things are looking as they should in the output from the following commands....

toby@archy ~ > timedatectl status
      Local time: Sat 2013-08-10 15:42:56 BST
  Universal time: Sat 2013-08-10 14:42:56 UTC
        Timezone: Europe/London (BST, +0100)
     NTP enabled: n/a
NTP synchronized: no
RTC in local TZ: no
      DST active: yes
Last DST change: DST began at
                  Sun 2013-03-31 00:59:59 GMT
                  Sun 2013-03-31 02:00:00 BST
Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2013-10-27 01:59:59 BST
                  Sun 2013-10-27 01:00:00 GMT
toby@archy ~ > sudo hwclock --debug
sudo: timestamp too far in the future: Aug 10 16:39:24 2013

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for toby:
hwclock from util-linux 2.23.2
Using /dev interface to clock.
Last drift adjustment done at 1376148264 seconds after 1969
Last calibration done at 1376148264 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/08/10 14:43:20
Hw clock time : 2013/08/10 14:43:20 = 1376145800 seconds since 1969
Sat 10 Aug 2013 15:43:20 BST  -0.953640 seconds

Is it OK to now reinstall NTP to keep the clock in sync on Arch, and are the Windows reg tweaks still necessary on Windows 8?

Thank you guys SOOO much for all the unbelievabley speedy help on this issue - you have no idea how much this has been stressing me out!!

Last edited by knowayhack (2013-08-10 14:54:31)


There is no truth. There is no reality. There is no consistency. There are no absolute statements. I am very probably wrong.

Offline

#16 2013-08-10 14:53:35

knowayhack
Member
From: UK
Registered: 2012-04-05
Posts: 22

Re: [SOLVED] Yet another time issue...

Trilby wrote:

No, not if you set your systems to be in UTC.

I'm starting to wonder if people know what UTC stands for.  This is a *very* common problem.  In fact, I'd guess nearly every single time/clock issue stems from this misunderstanding.  UTC stands for Universal Time (or Coordinated Universal Time really).  There is only one Universal time in the whole ... well, planet not universe, so maybe it should be Planetary Time, but anyhow...

Universal time will match local time in only one time zone.  For everyone else, local time is some hour offset from Universal Time.  So if your hardware clock is in UTC, then your hardware clock should be some number of hours offset from your wallclock (assuming you set your wall clocks in local time).

If your hardware clock matches the clocks set to your local time zone, then your hardware clock is in local time (I really don't see how this confuses people, but experience shows that it really does).

Cheers for the explanation. That does make a lot more sense now. Yes, I have to say that that was not AT ALL how I assumed it worked - which just goes to prove the cliche about assumption....


There is no truth. There is no reality. There is no consistency. There are no absolute statements. I am very probably wrong.

Offline

#17 2013-08-10 14:58:33

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

Re: [SOLVED] Yet another time issue...

No problem, as I said this is a very common misconception - so you are in good company (or at least in a lot of a company! wink )

I can't help with windows at all though.  You will need to set windows to know the hardware clock is in UTC.  I think the wiki is up to date on this - so go with that, and if it causes problems, follow up on it.

NTPD can be reactivated if you want to use it.  I don't use it as a daemon myself (just periodic/manual one-off adjustments), so check the documentation/wiki on how to ensure it sets time to the hardware clock if you want it to as in some modes it will only set the system clock.  This will not have any ill effects either way in terms of time zones or being off by large chunks of time, but will only ensure any small adjustments made by ntpd cary over to the next boot.


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

Offline

#18 2013-08-10 15:11:09

knowayhack
Member
From: UK
Registered: 2012-04-05
Posts: 22

Re: [SOLVED] Yet another time issue...

Yeah, so I had already done the Windows reg tweak and turned off sync, so I'm loath to muck with it now that it's finally working. I'm not that much of a glutton for punishment! However I've enabled NTP, as I like the idea of not having to keep an eye on time skew, but will have a thorough read of the docs, and will check that all is well following a couple of reboots, then mark the thread as solved.

Cheers! :-)


There is no truth. There is no reality. There is no consistency. There are no absolute statements. I am very probably wrong.

Offline

Board footer

Powered by FluxBB