CentOS 使用 NTP 同步时间时区错误的问题

问题描述

当我使用 ntp 客户端从服务端同步时间

 ntpdate -u 192.168.10.123
 
 4 Nov 07:30:19 ntpdate[19570]: adjust time server 192.168.10.123 offset -0.000112 sec

根据日志显示同步成功,但是时区明显不对,相差 12 个小时

解决方法

首先通过命令指定时区为 Asia/Shanghai

 timedatectl set-timezone Asia/Shanghai

再次同步时间

 ntpdate -u 192.168.10.123
 
 4 Nov 19:43:21 ntpdate[19744]: adjust time server 192.168.10.123 offset -0.000637 sec

这次就对了

猜你喜欢

转载自blog.csdn.net/qq12547345/article/details/127695136