CentOS修改系统时间为北京时间的命令

1.删除本地时间并设置时区为上海

rm -rf /etc/localtime

 ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2.用date看下时间是否正确,不正确的话继续下面的操作,使用ntp同步一下时间

3,yum -y install ntpdate ntp

4,ntpdate stdtime.sinica.edu.tw   www.th7.cn

5,设置硬件时间和软件时间的一致并校准

    /sbin/hwclock --systoh

猜你喜欢

转载自my.oschina.net/u/3693993/blog/2885431