PHP date函数报错
Jun 06, 2016 pm 07:52 PM欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入 使用date函数,可以成功获取系统时间,但error_log出现如下报错: PHP Strict Standards: date() [ahref='function.date'function.date/a]: It is not safe to rely on the system's timezone sett
欢迎进入Linux社区论坛,与200万技术人员互动交流 >>进入
使用date函数,可以成功获取系统时间,但error_log出现如下报错:
PHP Strict Standards: date()
[
Please use the date.
timezone setting, the TZ environment variable 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 'UTC/0.0/no DST' instead in /home/6wchxfpo4rhtquknkascto6m/wwwroot/share.php on line 10
这是由于date函数无法获取时区信息所致。
解决方案:
在date之前定义所使用的时区,如:
date_default_timezone_set('UTC');

熱門文章

熱門文章

熱門文章標籤

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

適用於 Ubuntu 和 Debian 的 PHP 8.4 安裝和升級指南

如何設定 Visual Studio Code (VS Code) 進行 PHP 開發
