Help us understand the problem. What is going on with this article?

PHP7調査(19)date.timezoneの設定がなくても怒られなくなる

More than 3 years have passed since last update.

PHP7から、date.timezoneが設定されていなくてもwarningが出なくなりました。デフォルトのタイムゾーンは今まで通りUTCです。

背景

PHP 5.3.0以降、php.iniでdate.timezoneを設定せずに日付系の関数を呼び出すと下記のようなwarningが表示されていました。

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 misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Command line code on line 1

しかし、PHPの実行バイナリ1個だけで動かしたいような状況もありうるので、設定ファイル無しでも正しく動作すべきだ、という提案が無事採用されたというわけです。

参照

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away