手动修改时间
date -s '2023-12-28 13:20:20'
查看当前服务器时间
date
使用ntp自动同步时间
ntpdate time.windows.com
sudo ntpdate time.windows.com
若提示the NTP socket is in use,则需要使用命令systemctl stop ntpd.service先停掉ntp,再使用自动同步时间命令
其他:
设置ntp服务开机不自启动
chkconfig ntpd off