timezone 선언후 mysql 에서도 설정되게 하기

This commit is contained in:
gnuboard
2013-05-02 15:37:35 +09:00
parent b916982262
commit 3323b80247
2 changed files with 4 additions and 1 deletions

View File

@ -95,6 +95,7 @@ if (file_exists($dbconfig_file)) {
$connect_db = sql_connect(G4_MYSQL_HOST, G4_MYSQL_USER, G4_MYSQL_PASSWORD) or die('MySQL Connect Error!!!');
$select_db = sql_select_db(G4_MYSQL_DB, $connect_db) or die('MySQL DB Error!!!');
@mysql_query(" set names utf8 ");
if (defined(G4_TIMEZONE)) @mysql_query(" set time_zone = '".G4_TIMEZONE."'");
} else {
?>

View File

@ -6,9 +6,11 @@
// 이 상수가 정의되지 않으면 각각의 개별 페이지는 별도로 실행될 수 없음
define('_GNUBOARD_', true);
define('G4_TIMEZONE', 'Asia/Seoul');
if (PHP_VERSION >= '5.3.0') {
//if (function_exists("date_default_timezone_set")) date_default_timezone_set("Asia/Seoul");
date_default_timezone_set("Asia/Seoul");
date_default_timezone_set(G4_TIMEZONE);
}
//==============================================================================