Commit b8ad3567 by Benjamin Wöster

set application timezone early in application constructor, set default of UTC if…

set application timezone early in application constructor, set default of UTC if no timezone is configured at all (not in app config nor in php.ini)
parent 810d232e
...@@ -84,6 +84,10 @@ class Application extends Module ...@@ -84,6 +84,10 @@ class Application extends Module
} else { } else {
throw new InvalidConfigException('The "basePath" configuration is required.'); throw new InvalidConfigException('The "basePath" configuration is required.');
} }
if (isset($config['timeZone']) || !ini_get('date.timezone')) {
$this->setTimeZone( \yii\helpers\ArrayHelper::remove($config,'timeZone','UTC') );
}
$this->registerErrorHandlers(); $this->registerErrorHandlers();
$this->registerCoreComponents(); $this->registerCoreComponents();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment