4

Since a few days my MacBook Air 2020 shows the wrong date when set to "Set date and time automatically". This is regardless of the chosen NTP server.

When time set manually, querying a NTP server from the command line returns:

$ sudo sntp -sS pool.ntp.org 
-9.789671 +/- 0.018845 pool.ntp.org 95.81.173.74

Which does not show date and time, but also no major offset.

The offset is consistent at 5 months, 2 days, 3 hours and 10 minutes.

  • Tried time.apple.com and pool.ntp.org. No luck.
  • Tried different time zones. No luck.
  • Tried VPN to fake a different physical location. No luck.
  • Changed WiFi networks, including using my phone as hotspot. No luck.
  • NVRAM reset didn't help. No luck.

Manually set correct date and time

Date and time set automatically —> Wrong, today is 30/9/2020

Fix

It somehow got fixed when I installed sntp (part of the ntp package) via Homebrew and ran it after running

sudo touch /var/db/ntp-kod
sudo chown root:wheel /var/db/ntp-kod

Note: I don't know if the installation of sntp via Homebrew is needed as macOS also has its own version.

Volsk
  • 3,040
  • I was hoping to try this, but Homebrew now gives this error when I try to install sntp: "Warning: No available formula with the name "sntp". Did you mean sntop, stp, ntp, snap or srtp?" – rep Jan 20 '22 at 09:18
  • It's part of ntp. – Volsk Jan 20 '22 at 10:44
  • Thanks for the tip. I'm experiencing similar issues, though the offset is different from yours (6 months something). Using sudo sntp -sS pool.ntp.org (with built-in sntp) does update the date and time to the correct one. However, if I switch "automatically sync date and time" off and on again, it's back to the same wrong date and time. Did your solution (using sntp from homebrew) also solve this issue? – renyuneyun Jan 09 '24 at 14:14
  • Yes, I used sntp from homebrew. As notec I also had to create some files. I think I had the checkmark set when I ran the command. But it's 3+ years ago.. – Volsk Jan 10 '24 at 10:35

2 Answers2

1

Excellent question. There is a lot that you can do to inspect this process.

Some things to point out:

  • Check which time servers you have selected
  • Change them and retest
  • If you have a VPN, try that and be sure you try without
  • Look over your time zone (set it if it’s not correct while you sort out the time servers

Some computer is telling yours the wrong time, so think about networks and then dig into the command line tools if needed.

bmike
  • 235,889
  • Thanks @bmike. I added some information to my original question. – Volsk Oct 01 '20 at 06:36
  • Awesome! Just making the tracking file seems a bit silly we have to do that in some cases... @Volsk - well done. – bmike Oct 01 '20 at 14:27
1

I recently encountered a similar issue, where the automatic time sync leads to months of time difference.

Tried the "solution" the OP mentioned, but it only worked for tens of minutes and was gone to the wrong one.

Later I found a solution for me from Reddit. The highest-rated comment proposes

sudo rm /var/db/timed/com.apple.timed.plist

followed by a reboot (!).

nohillside
  • 100,768