首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

批改Centos的系统时间为北京时间

2012-07-20 
修改Centos的系统时间为北京时间修改Centos的系统时间为北京时间?!-- end: entry_title_box -- 今天添加

修改Centos的系统时间为北京时间
修改Centos的系统时间为北京时间?

<!-- end: entry_title_box -->

今天添加自动任务的时候发现服务器的时候不是北京时间,现在我们将它改为北京时间。

1.删除本地时间并设置时区为上海
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2.用date看下时间是否正确,不正确的话继续下面的操作,使用ntp同步一下时间
ntpdate stdtime.sinica.edu.tw
3.如果提示command not found,那说明ntp没有安装,使用如下命令进行安装
yum -y install ntpdate ntp
安装完成后重新执行第二步命令。
执行完成后用date命令看看吧,是不是已经为北京时间了。

?

4、设置硬件时间和软件时间的一致并校准
/sbin/hwclock --systohc

热点排行