1. 程式人生 > >CentOS修改系統時間為北京時間的命令

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