如何从PHP中的date()修复警告“ [英] How to fix warning from date() in PHP"
问题描述
严重性:警告
消息: date()[function.date]:它是
不安全依靠系统的
时区设置。您需要
以使用date.timezone设置或
date_default_timezone_set()
函数。如果您使用任何
这些方法,您仍然
得到此警告,您很可能
拼写时区标识符。我们
为'8.0 / no DST'
选择'UTC'
文件名:helpers / date_helper.php
如何禁用警告?谢谢。
尝试在<$ c中设置 date.timezone
$ c> php.ini 文件。或者您可以使用 ini_set()
或 date_default_timezone_set()
手动设置。
I am using XAMPP(PHP Version 5.3.1) on winxp. When I try to call time() or date() function on my localhost. It will show warning message as this,
Severity: Warning
Message: 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 'UTC' for '8.0/no DST' instead
Filename: helpers/date_helper.php
How can I disable the warning? Thanks.
Try to set date.timezone
in php.ini
file. Or you can manually set it using ini_set()
or date_default_timezone_set()
.
这篇关于如何从PHP中的date()修复警告“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!