如何在没有互联网的情况下更新树莓派的日期和时间 [英] How to Update Date and Time of Raspberry Pi With out Internet

查看:158
本文介绍了如何在没有互联网的情况下更新树莓派的日期和时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将 Raspberry Pi 连接到 LAN,但没有可用的互联网.有没有什么方法可以在 LAN 中使用 PC(Windows 7)更新树莓派日期时间?我想在 Raspberry Pi 启动时获取计算机的日期和时间.

I have connect my Raspberry Pi to LAN but there is no internet available. Is there any method to update raspberry pi date time by using a PC (windows 7) in LAN? I want to get computer date and time to my Raspberry Pi when it is booting.

推荐答案

请记住,Raspberry Pi 没有实时时钟.因此,即使您已连接到互联网,每次开机或重新启动时也必须设置时间.

Remember that Raspberry Pi does not have real time clock. So even you are connected to internet have to set the time every time you power on or restart.

这是它的工作原理:

  1. 在树莓派命令行中输入 sudo raspi-config
  2. 国际化选项
  3. 更改时区
  4. 选择地理区域
  5. 选择城市或地区
  6. 重启你的 pi

接下来您可以使用此命令设置时间

Next thing you can set time using this command

sudo date -s "Mon Aug  12 20:14:11 UTC 2014"

更多关于数据和时间

man date

当树莓派连接到电脑时需要手动设置数据和时间

When Pi is connected to computer should have to manually set data and time

这篇关于如何在没有互联网的情况下更新树莓派的日期和时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆