文档首页> 常见问题> centos系统如何同步时间

centos系统如何同步时间

发布时间:2023-03-09 18:21       

linux系统的时间同步主要分两种:

下面主要针对centos系统进行说明,其他系统都类似

 

一、同步时区

date -R #查看时区

timedatectl list-timezones #列出所有时区

timedatectl set-timezone Asia/Shanghai #设置系统时区为上海

二、同步时间

1.安装ntpdate工具

yum -y install ntp ntpdate

2.设置系统时间与网络时间同步

ntpdate http://cn.pool.ntp.org

3、再重新检查当前时间:

date

只有保证服务器时间是ok的,才能保证业务是正确的哈