centos 修改系统时间


[root@bogon vagrant]# date
Tue Jun 25 12:12:23 UTC 2019

2、 查看当前时区

[vagrant@bogon ~]$ timedatectl status
Local time: Tue 2019-06-25 20:29:47 CST
Universal time: Tue 2019-06-25 12:29:47 UTC
RTC time: Tue 2019-06-25 12:29:50
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: yes
DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
This mode can not be fully supported. It will create various problems
with time zone changes and daylight saving time adjustments. The RTC
time is never updated, it relies on external facilities to maintain it.
If at all possible, use RTC in UTC by calling
‘timedatectl set-local-rtc 0’.


[root@bogon vagrant]# date -s “2019-06-25 20:13:00”
Tue Jun 25 20:13:00 UTC 2019


[root@bogon vagrant]# timedatectl set-timezone Asia/Shanghai

5、 查看硬件时间

[root@bogon vagrant]# hwclock –show
Tue 25 Jun 2019 08:13:56 PM CST -0.891529 seconds

6、 同步系统时间和硬件时间

[root@bogon vagrant]# hwclock –hctosys

7、 本地时间写入硬件时间

[root@bogon vagrant]# timedatectl set-local-rtc 1
[root@bogon vagrant]# date
Tue Jun 25 20:14:35 CST 2019

8、重启系统 reboot