The method of correcting the date and time of Raspberry Pi (Raspberry Pi)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.