树莓派修改时间

执行su切换到root用户

pi@raspberrypi:~ $ su 

Password: 

  

执行date -R查看时间

root@raspberrypi:/home/pi# date -R
Sun, 13 Oct 2019 09:53:10 +0000

执行dpkg-reconfigure tzdata 修改时区到asia/shanghai 

root@raspberrypi:/home/pi# dpkg-reconfigure tzdata

Current default time zone: 'Asia/Shanghai'
Local time is now: Sun Oct 13 17:53:36 CST 2019.
Universal Time is now: Sun Oct 13 09:53:36 UTC 2019.

执行apt-get install ntpdate 

root@raspberrypi:/home/pi# apt-get install ntpdate
Reading package lists... Done
Building dependency tree
Reading state information... Done
ntpdate is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 310 not upgraded. 

设置ntpdate ntp.sjtu.edu.cn

root@raspberrypi:/home/pi# ntpdate ntp.sjtu.edu.cn
13 Oct 17:53:54 ntpdate[1714]: the NTP socket is in use, exiting 


data查看时间 已经对了
root@raspberrypi:/home/pi# date
Sun 13 Oct 17:53:59 CST 2019
root@raspberrypi:/home/pi#  

Last modification:October 13th, 2019 at 05:56 pm
如果觉得我的文章对你有用,请随意赞赏

Leave a Comment