Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm running Arch Linux. Recently, when I turn on my PC, the system time is set to 1:00 1 January 1970 - presumably the 1:00 o'clock is from the timezone shift.

Does anyone have any ideas why systemd isn't setting my system time correctly?

Some useful output (I think)...

[root@alex-desktop network.d]# timedatectl status
      Local time: Sun 2013-06-09 16:33:04 BST
  Universal time: Sun 2013-06-09 15:33:04 UTC
        RTC time: Sun 2013-06-09 15:18:50
        Timezone: Europe/London (BST, +0100)
     NTP enabled: yes
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
share|improve this question
1  
So who is reporting the wrong time? What you are showing is the correct date. –  terdon Jun 9 '13 at 15:48
    
I don't really understand your problem. According to the timedatectl status command everything looks fine. Does the reset time occur at every reboot? –  Nicolas Jun 9 '13 at 21:05
    
I posted the command after I fixed it... oops. System time is wrong after every reboot. –  Alex Chamberlain Jun 10 '13 at 8:17
add comment

1 Answer

I had a similar problem with a Raspberry Pi (which apparently has no RTC), so either you're using a similar device that also doesn't have one (unlikely), or your computer is a bit older and the RTC's battery, aka CMOS battery has run flat.

According to your timedatectl status you already have NTP enabled, which should query a time server and set the time for you. However, this seems to not work if you are not connected to the internet when the time is set when you boot the computer, which can happen if you're using WLAN and it takes a long time to connect.

In the end my solution was to add a cron job for root (su -c "crontab -e") to run ntpd -s once a minute to force checking the time, like so:

# sync network time every minute (this is sad)
* * * * *               ntpd -s

Problem solved.

The ntpd ntpd.conf man page mentions a minpoll option which can allegedly be used to make ntpd check as frequently as 8 seconds. This is obviously over 9000 times better and I shall update my answer if this works as expected.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.