美文网首页
Centos7修改系统时间硬件时间

Centos7修改系统时间硬件时间

作者: yhyok | 来源:发表于2017-12-27 09:51 被阅读15次

查看系统时间
[root@localhost ~]# date

查看硬件时间
[root@localhost ~]# hwclock --show

假如系统时间和硬件时间都不准确
更新系统年月日
[root@localhost ~]# timedatectl set-time 2017-06-13

更新系统时分秒
[root@localhost ~]# timedatectl set-time 10:25:17

更新时区(亚洲-中国-上海)
[root@localhost ~]# timedatectl set-timezone Asia/Shanghai

将硬件时钟调整为与系统时钟一致
[root@localhost ~]# timedatectl set-local-rtc 1
或者
[root@localhost ~]# hwclock --systohc --localtime

将日期写入CMOS
[root@localhost ~]# clock –w

关闭时钟自动同步
timedatectl set-ntp 0
开启时钟自动同步
timedatectl set-ntp 1

相关文章

网友评论

      本文标题:Centos7修改系统时间硬件时间

      本文链接:https://www.haomeiwen.com/subject/bavygxtx.html