LoginSignup
15
14

More than 5 years have passed since last update.

PHP5以降で起こるdate関数エラー

Posted at

PHP5、正確にはPHP 5.1.0 以降で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.

解決策1

phpファイル内に以下を記述。これだけでOK。

date_default_timezone_set('Asia/Tokyo');

解決策 2

php.ini に以下を記述。

date.timezone = Asia/Tokyo
15
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
14