标签存档: timezone

Local time zone must be set–see zic manual page

解决办法:

ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

Warning: date() [function.date]: It is not safe to rely on the system’s timezone settings.

运行部分php时,有时会出现如下错误:

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings.

这是php的时区设置方面的问题,解决办法:
修改php.ini文件,将

; date.timezone =

改为:

date.timezone = "Asia/Shanghai"

修改ubuntu的时区设置

我的vps是burst的,ubuntu server,发表blog的时间一直是UTC时间,网上搜索了一下,找到了这篇文章,把时区改成了CST时间。

tzselect //按照提示进行选择时区
sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

另外,在php探针中的时间也不对,修改php.ini后得到正确的CST时间。

It is not safe to rely on the system’s timezone settings

gentoo上安装的php页面出现下面的错误:

Warning: date() [function.date]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Chongqing’ for ‘CST/8.0/no DST’ instead in /home/gentoo/www/blog/i.php on line 368

原来是php.ini的设置问题。把php.ini中的时区设置正确就可以了:

#date.timezone =

改为:

date.timezone = “Asia/Shanghai”