I set the timezone in my Yii2 application as stated in the docs in config/web.php:
'timeZone' => 'Europe/Berlin',
But: this is only valid for Yii2 and obviously not for PHP functions e.g. date()
.
The PHP timezone settings remain unchanged so there is a difference between PHP and Yii2.
How can I make the Yii2 timezone the leading timezone which sets the PHP timezone according to the timezone settings in Yii2 configuration?
EDIT
The timezone is set in the application component \Yii::$app
, not in the formatter component.
I cannot modify php.ini
file.