,转Centos7 修改硬件时间和系统时间

    • 查看硬件时间
    [root@localhost ~]# hwclock --show
    Tue 13 Jun 2017 02:11:12 AM CST  -0.848845 seconds
    • 1
    • 2

    可以看出系统时间比硬件时间快,系统时间是准确的

假如系统时间和硬件时间都不准确

  • 更新系统年月日
[root@localhost ~]# timedatectl set-time 2017-06-13
  • 更新系统时分秒
[root@localhost ~]# timedatectl set-time 10:25:17
  • 1

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

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