linux系统同步时间

linux系统同步时间

1、安装ntp

通过buildroot安装ntp包

2、查看时间

date

注:查看时区

3、同步时间

同步时间命令:

ntpdate -u ntp-server

注:ntpdate 加上-u 参数同步,否则会出现如下错误:no server suitable for synchronization found。

4、可使用的ntp服务器

NTP服务器(上海) :ntp.api.bz

中国国家授时中心:210.72.145.44

阿里云:ntp1.aliyun.com

美国:time.nist.gov

复旦:ntp.fudan.edu.cn

微软公司授时主机(美国) :time.windows.com

台警大授时中心(台湾):asia.pool.ntp.org

5、同步时间后与实际时间相差X小时

同步时间后发现比正常时间慢12小时,时时区不同的问题导致的。

北京时间使用的是CST,美国东部夏令时期是EDT。

要调时区,所有的时区都是在/usr/share/zoneinfo/Asia目录下,有很多亚洲的时区,我们选择Shanghai这个时区。

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

转载说明:
原文链接:
1、

https://blog.csdn.net/xjjj064/article/details/112345569?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167954205316800182145177%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=167954205316800182145177&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2

2、

https://blog.csdn.net/weixin_30261095/article/details/101355539?ops_request_misc=&request_id=&biz_id=102&utm_term=linux同步的时间和实际时间相差12小时&utm_medium=distribute.pc_search_result.none-task-blog-2

posted @   Rxin  阅读(718)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
点击右上角即可分享
微信分享提示