1.设置时区为上海

#rm -rf /etc/localtime
#cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2 修改日期时间

查看时间命令:

#date

使用“date -s”命令来修改系统时间。

比如将系统时间设定成2013年3月4日的命令如下。

#date -s 03/04/2013

将系统时间设定成下午1点12分0秒的命令如下。

#date -s 13:12:00

或者用使用ntp同步一下时间

#ntpdate stdtime.sinica.edu.tw

如果提示command not found,那说明ntp没有安装,使用如下命令进行安装

#yum -y install ntpdate ntp

然后在执行:ntpdate stdtime.sinica.edu.tw

3 同步硬件时间和软件时间

#/sbin/hwclock --systoh 或者 clock -w

转载请注明转自: http://huangmumu.com/20130305/587.html | 木木之家