CentOS时间相差8小时解决方法

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

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

 2 下载ntp(需要联网)

# yum -y install ntp

3  校对时间

# ntpdate cn.pool.ntp.org

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

# hwclock -w

4 查看date

[root@localhost ~]# date