php日期问题

WBOY
Lepaskan: 2023-03-02 08:34:01
asal
986 orang telah melayarinya

<code><?php echo "今天是 " . date("Y/m/d") . "<br>";

?>
出现这个是什么原因</code>
Salin selepas log masuk
Salin selepas log masuk

php日期问题
Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. 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 '8.0/no DST' instead in F:appappserverAppServwwwdate1.php on line 7
浠婂ぉ鏄� 2016/11/08

回复内容:

<code><?php echo "今天是 " . date("Y/m/d") . "<br>";

?>
出现这个是什么原因</code>
Salin selepas log masuk
Salin selepas log masuk

php日期问题
Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. 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 '8.0/no DST' instead in F:appappserverAppServwwwdate1.php on line 7
浠婂ぉ鏄� 2016/11/08

在使用之前设置时区。

应该是时区不对 设置下时区
传送 设置时区方法 http://www.jb51.net/article/3...
有用顶下 采纳 谢谢

时区没有设置,更改一下php.ini文件中的date.timezone = PRC ,进行如上的更改,然后重启一下服务器

<code>date_default_timezone_set('PRC');
</code>
Salin selepas log masuk

修改php.ini的配置项data.timezone = "Asia/Shanghai"。或者如下

<code><?php date_default_timezone_set('Asia/Shanghai');
echo "今天是 " . date("Y/m/d") . "<br>";
</code>
Salin selepas log masuk
Label berkaitan:
php
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan
Tentang kita Penafian Sitemap
Laman web PHP Cina:Latihan PHP dalam talian kebajikan awam,Bantu pelajar PHP berkembang dengan cepat!