/ / Date - Phpのタイムゾーン設定 - php、function、date

日付 - PHP、関数、日付のタイムゾーン設定

私はこのエラーを出し続けます、私は何をすべきかわかりません、それはまだ他のプロジェクトで働いていました、この現在のプロジェクトの上でまだこのエラーを与え続けています

Warning: 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 misspelt the timezone identifier. We selected the timezone "UTC" for now, but please set date.timezone to select your timezone. in /home/ediyeng/public_html/app/app.php on line 9

以下はコードです

<?php
echo date(DATE_RFC2822);
?>

回答:

回答№1は2

タイムゾーンを設定していないか、スペルミスがあるようです。

これを修正するには、各phpファイルまたはphp.iniの2つの方法があります。

各phpファイルに次の行を追加してナイジェリアのタイムゾーンに設定することができます。
<Edit> you could possibly also add this line to a header file you include in all php files if you have a header file </edit>

date_default_timezone_set("Africa/Lagos");

あるいは、php.iniを編集することもできます(スペルミスのあるタイムゾーンも存在する可能性があります)。
次のような行を見つけます。

date.timezone = ....

そしてそれを

date.timezone = "Africa/Lagos"