14
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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
14
13
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
14
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?