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)

This commit is contained in:
Benjamin Wöster
2013-05-10 13:49:42 +02:00
parent 810d232ee6
commit b8ad3567e4

View File

@ -84,6 +84,10 @@ class Application extends Module
} else {
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->registerCoreComponents();