From e1c5769a3064d40a19b0b002463738d57a2a29ee Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 14 Dec 2015 12:13:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=BB=98=E8=AE=A4=E6=97=B6?= =?UTF-8?q?=E5=8C=BA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- convention.php | 2 ++ library/think/app.php | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/convention.php b/convention.php index 74ff049c..24b2f173 100644 --- a/convention.php +++ b/convention.php @@ -21,6 +21,8 @@ return [ 'default_jsonp_handler' => 'jsonpReturn', // 默认JSONP处理方法 'var_jsonp_handler' => 'callback', + // 默认时区 + 'default_timezone' => 'PRC', // +---------------------------------------------------------------------- // | 模块设置 diff --git a/library/think/app.php b/library/think/app.php index a303c78c..1459f9f4 100644 --- a/library/think/app.php +++ b/library/think/app.php @@ -47,6 +47,8 @@ class App if (SLOG_ON) { Slog::config($config['slog']); } + // 设置系统时区 + date_default_timezone_set($config['default_timezone']); // 默认语言 $lang = strtolower($config['default_lang']); @@ -273,10 +275,10 @@ class App $depr = $config['pathinfo_depr']; // 还原劫持后真实pathinfo $path_info = - (defined('BIND_MODULE') ? BIND_MODULE . $depr : '') . - (defined('BIND_CONTROLLER') ? BIND_CONTROLLER . $depr : '') . - (defined('BIND_ACTION') ? BIND_ACTION . $depr : '') . - __INFO__; + (defined('BIND_MODULE') ? BIND_MODULE . $depr : '') . + (defined('BIND_CONTROLLER') ? BIND_CONTROLLER . $depr : '') . + (defined('BIND_ACTION') ? BIND_ACTION . $depr : '') . + __INFO__; // 路由检测 if (!empty($config['url_route_on'])) {