From b005b087b4d64b116ea4ac675864f609ca406bd2 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sat, 11 May 2013 01:17:51 +0200 Subject: [PATCH] better have timezone fix in application app is resposible for setting time zone, so it should also do the fixing. + documentation about the behavior. issue #210 and #209 --- apps/bootstrap/index.php | 3 --- yii/base/Application.php | 6 ++++++ yii/yiic.php | 4 ---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/bootstrap/index.php b/apps/bootstrap/index.php index dec6e35..a0488ca 100644 --- a/apps/bootstrap/index.php +++ b/apps/bootstrap/index.php @@ -1,7 +1,4 @@ setTimeZone('UTC'); + } + $this->registerErrorHandlers(); $this->registerCoreComponents(); @@ -222,6 +226,8 @@ class Application extends Module /** * Returns the time zone used by this application. * This is a simple wrapper of PHP function date_default_timezone_get(). + * If time zone is not configured in php.ini or application config, + * it will be set to UTC by default. * @return string the time zone used by this application. * @see http://php.net/manual/en/function.date-default-timezone-get.php */ diff --git a/yii/yiic.php b/yii/yiic.php index 3be0436..7cd0c40 100644 --- a/yii/yiic.php +++ b/yii/yiic.php @@ -7,10 +7,6 @@ * @license http://www.yiiframework.com/license/ */ -if(!ini_get('date.timezone')) { - date_default_timezone_set('UTC'); -} - defined('YII_DEBUG') or define('YII_DEBUG', true); // fcgi doesn't have STDIN defined by default