On the Raspberry Pi, you can see the date and time of the system by playing the date command:
Small knowledge:
The Raspberry Pi does not have a battery and cannot save the time after a power outage.
The Raspberry Pi is installed by default with the NTP (Network time Protocol) service to obtain the times provided by the NTP server on the Internet.
If this time is not allowed, you can calibrate it with this command.
sudo ntpd-s-D
If you're not allowed to, use this command to force the setting
That's what I'm going through, time is gone, but the system date is always 2014-06-20.
sudo date --s="2014-08-31 14:42:00"
Finally, add some of the domestic available NTP servers , if your time is normal, you can not do these settings.
Open the configuration file for the NTP service
sudo nano/etc/ntp.conf
Find these two lines
# You do need-to-talk-to-an NTP server or both (or three). Server Ntp.your-provider.example
Add the following below, which are some of the pro-Test available NTP servers
The last perfer of the first line indicates the priority of using this server, which is the NTP server at Fudan University
Press Ctrl+x to save and exit after adding
Server ntp.fudan.edu.cn iburst perferserver time.asia.apple.com iburstserver asia.pool.ntp.org iburstserver ntp.nict.jp Iburstserver time.nist.gov Iburst
Restart the NTP service
sudo /etc/init.d/ntp restart
The method of correcting the date and time of Raspberry Pi (Raspberry Pi)