Browse Source

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)

tags/2.0.0-beta
Benjamin Wöster 12 years ago
parent
commit
b8ad3567e4
  1. 4
      yii/base/Application.php

4
yii/base/Application.php

@ -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();

Loading…
Cancel
Save