#step1 安装ntpdate
#centos
yum -y install ntpdate
# ubuntu
apt install ntpdate
#step2 同步时间
ntpdate -u pool.ntp.org
#同步完成后,date命令查看时间是否正确
date
centos和ubuntu同步时间
于 2022-03-26 18:08:46 首次发布
#step1 安装ntpdate
#centos
yum -y install ntpdate
# ubuntu
apt install ntpdate
#step2 同步时间
ntpdate -u pool.ntp.org
#同步完成后,date命令查看时间是否正确
date