问题描述:在centos服务器上执行date命令时,显示的时间信息中的时区不正常,以下:vim
[root@ulocalhost ~]# date Mon Apr 9 02:57:38 Local time zone must be set--see zic manual page 2018
即显示Local time zone must be set--see zic manualcentos
解决办法:bash
1)查看软链接是否在本地时区,这里我选择上海时区服务器
[root@localhost ~]# rm -f /etc/localtime [root@localhost ~]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime [root@localhost ~]# ll /etc/localtime lrwxrwxrwx 1 root root 33 Apr 9 10:57 /etc/localtime -> /usr/share/zoneinfo/Asia/Shanghai
2)接着执行spa
[root@localhost ~]# export TZ='Asia/Shanghai' [root@localhost ~]# vim ~/.bashrc //文件底部添加下面内容 ...... export TZ='Asia/Shanghai'
注意:以上是在root用户下生效的操做,若是在普通用户下,可能还会出现"Local time zone must be set--see zic manual",这就须要在普通用户下执行"export TZ='Asia/Shanghai'",以及把这个命令写入到普通用户的.bashrc文件里。blog