the problem is my raspberry pi 3 doesn't show the correct date and time.i edit this file: sudo nano /etc/ntp.conf with correct server addresses and i try this commands :

sudo /etc/init.d/ntp stop
sudo ntpd -q-g

but i get this error:

/usr/sbin/ntpd: illegal option -- -
ntpd - NTP daemon program - Ver. 4.2.8p10
Usage:  ntpd [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \
    [ <server1> ... <serverN> ]
Try 'ntpd --help' for more information.

how can i correct this error? thank you

  • Raspbian doesn't use ntpd – Milliways Dec 13 '18 at 9:41
  • 1
    @Milliways it does run NTP when you eliminate the timesyncd junk. I have one raspberry running an NTP server and seventeen running an NTP client getting the time from the local server. – Dougie Dec 13 '18 at 16:30
  • 1
    @Dougie timesyncd is the Debian default used to synchronize the local system clock with a remote Network Time Protocol server and works for the vast bulk of users. There is no reason to think the OP has installed ntpd; it seems more likely to be following an obsolete tutorial. Unless this is clarified answering seems pointless, and the question would still not be Raspberry Pi specific – Milliways Dec 14 '18 at 7:07

Run it as sudo ntpd -q -g note that space between the options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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