Posts: 99
spaceman
Joined: 07 Feb 2013
#1
I used antiX Core to build a nice little Xfce install that I use to run games in Wine. Framerates are superb.

I only have one issue and I've been pounding the Interwebs for weeks trying to resolve it myself, so finally I'm here asking my fellow antiXers if they've had this problem, how they fixed it, if not what can they suggest?

Every time I reboot my clock reverts to 5 hours earlier...I thought it would be easy to fix, but it's getting old entering this everyday:

Code: Select all

sudo date --set="03/18/13 14:46:00"
OK, it works, but as this is the only snagging point of my tiny install I would like to make it go away then I could say"That's perfect."

Cheers guys. __{{emoticon}}__
Last edited by spaceman on 18 Mar 2013, 18:41, edited 1 time in total.
Alanarchy
Posts 0
Alanarchy
#2
If all else has failed, buy a new BIOS battery. If it has died, every time you shut down it"forgets" what time it is simply because the memory requires current from the battery.

The other thing may be you have it set to UT, or to Greek time (default).
Posts: 137
duncan_mk
Joined: 19 Sep 2012
#3
Alanarchy could well be right about where you are geographically. I'm guessing it's not the States or I would expect the difference to be greater than 5 hours.

Try Googling"Linux global time" - I use the StartPage search engine from lxQuick but they lean pretty heavily on Google, there are variations on what their searches throw up but you should find plenty.

dmk
Posts: 1,308
BitJam
Joined: 31 Aug 2009
#4
There are 3 possible issues:

1) wrong timezone
2) wrong selection of UTC versus local time
3) BIOS clock set wrong

The first issue is addressed with"sudo dpkg-reconfigure tzdata". Do this first. You should also be able to just check the current value with"cat /etc/timezone".

Once you are sure the timezone is correct, you can work on setting your BIOS clock. Do this with the hwclock command. First do a"man hwclock" and then run"hwclock --show" to see what it is set to. It always reports in localtime which is why you need to first make sure your timezone is set correctly.

Use"hwclock --localtime" or"hwclock --utc" depending on whether you want your hardware clock to be set to localtime or utc. Most pure Linux systems use utc. Most dual boot systems use localtime.

Then, after you get your date command working via the sudo command you posted, you can use"hwclock --systohc" to set the hardware clock so it matches your system time. Again, you need the timezone and localtime/utc choice set correctly first (although if you want to *assume* they are set correctly already then this is the only command you need to run to get your changes to the"date" command to stick. If you assumed incorrectly then you will likely get mysteriously screwed by DST a few times per year).

Finally, if you are having problems with hwclock drift or if you are a perfectionist then you can install the"ntp" package which will use time servers on the net to keep your clock exactly on time. But you have to first go through the steps above before ntp will work correctly.
Posts: 99
spaceman
Joined: 07 Feb 2013
#5
Guys! Superb resources Googled (@DuckDuckGo tbh), I'll be setting up my home server as an ntp repeater next.

BitJam, you completely nailed it. For everyone else my exact steps in summary:

Code: Select all

sudo dpkg-reconfigure tzdata

Code: Select all

# hwclock --show
Mon 18 Mar 2013 18:17:30 GMT  -0.656621 seconds

Code: Select all

# hwclock --utc
Mon 18 Mar 2013 18:19:59 GMT  -0.937800 seconds

Code: Select all

# date --set="03/18/13 18:21:00"
Mon Mar 18 18:21:00 GMT 2013

Code: Select all

# hwclock --systohc
One reboot later and I can confirm the time is correct and I am a happy bunny. Right tiny PulseAudio niggle to fix now. __{{emoticon}}__
Last edited by spaceman on 19 Mar 2013, 00:11, edited 1 time in total.
Alanarchy
Posts 0
Alanarchy
#6
Pulse-Audio is easily fixed! apt-get -remove -purge pulseaudio __{{emoticon}}__