centos7系统更新系统时间时区、硬件时间、并写入CMOS

2019年8月14日教程大全centos时区更新,centos系统时间,硬件时间

centos7系统更新系统时间时区、硬件时间、并写入CMOS

硬件时间显示的是12小时制,AM是上午,PM是下午。

查看系统时间

date

查看硬件时间

hwclock --show

更新时区

timedatectl set-timezone Asia/Shanghai

安装ntpdate

yum -y install ntp ntpdate

同步网络时间

ntpdate cn.pool.ntp.org
#如果提示 no server suitable for synchronization found就用下面的
ntpdate -v 1.ntp.company.com

将硬件时间和系统时间调整一致

timedatectl set-local-rtc 1
#或者
hwclock --systohc --localtime

将时间写入CMOS

clock –w

 

下图:

1.硬件时间和系统时间不一致

2.设置完成后再次查看

Posted by 柴郡猫