设置centos7上的时间与网络同步

# date // 查看系统时间
#hwclock // 查看硬件时间

# yum -y install ntp ntpdate 安装ntpdate工具

# ntpdate cn.pool.ntp.org  设置系统时间与网络时间同步

# hwclock --systohc  将系统时间写入硬件时间


timedatectl # 查看系统时间方面的各种状态
timedatectl list-timezones # 列出所有时区

timedatectl set-local-rtc 1 # 将硬件时钟调整为与本地时钟一致, 0 为设置为 UTC 时间

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

  

猜你喜欢

转载自www.cnblogs.com/kevin-ying/p/11119694.html