2011-04-04 27 views

回答

3

首先,在您的配置文件设置你的主人时提及“GMT”:

$config['time_reference'] = 'gmt'; 

选择从时区参考http://codeigniter.com/user_guide/helpers/date_helper.html或使用timezone_menu()设置一个变量或更新$一个数据库列时区的代码如下:

$time = now(); 
$timezone = 'UM5'; 
$daylight_saving = TRUE; // or FALSE 
$local_time = unix_to_human(gmt_to_local($time, $timezone, $daylight_saving)); 
echo $local_time;