# ntp doesn't work in raspberry pi

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> ]

• Raspbian doesn't use ntpd – Milliways Dec 13 '18 at 9:41
• @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.