VMware安装CentOS后时间相差8小时解决方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/CleverCode/article/details/86539737

1 如果发现date与现在的时间差8个小时,需要修改。

2 date之后,发现没有CTS(中国标准时间:China Standard Time UT+8:00)
在这里插入图片描述

3 将/etc/localtime指向上海时间

# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

然后再date可以看到CST了。
在这里插入图片描述

4 下载ntp(需要联网)

# yum -y install ntp

5 校对时间

# ntpdate cn.pool.ntp.org

6 将系统时间写入硬件(这步如果不执行重启机器后时间又会出问题)

# hwclock -w

7 查看date

[root@localhost ~]# date
2019年 01月 18日 星期五 14:44:00 CST
[root@localhost ~]#

猜你喜欢

转载自blog.csdn.net/CleverCode/article/details/86539737