我突然在我已经完成的网站上收到以下错误,到目前为止工作正常:
A PHP Error was encountered
Severity: Warning
Message: mktime() [function.mktime]: 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 'Antarctica/Macquarie' for 'EST/10.0/no DST' instead
Run Code Online (Sandbox Code Playgroud)
这是有问题的代码:
$stamp=mktime(0,0,0,$month,$day,$year);
Run Code Online (Sandbox Code Playgroud)
这是什么问题?如何快速消除这些错误?我mktime在很多地方使用这种格式,并在每个地方抛出错误.
由于错误的说法,你要么需要使用指定时区date_default_timezone_set('Antarctica/Macquarie');或ini_set('date.timezone', 'Antarctica/Macquarie');在你的代码或定义date.timezone中php.ini.
| 归档时间: |
|
| 查看次数: |
8238 次 |
| 最近记录: |