修正redhat linux时区设置错误
在一个服务器上,打开另一个服务器生成的tar包,显示提示:文件是将来的时间:
tar: time stamp 2017-02-07 17:44:58 is 14509.233807047 sin the future
# date
Tue Feb 7 05:48:10EST 2017
cat /etc/sysconfig/clock
# The ZONE parameter is only evaluated bysystem-config-date.
# The timezone of the system is defined by the contents of/etc/localtime.
ZONE="America/New_York"
UTC=true
ARC=false
这是时区错误造成的,本服务器时区是纽约,而另一个服务器是上海
做如下操作,修改时区:
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
reboot
重启后显示:
# date
Tue Feb 7 18:59:28CST 2017