Method 1:
Find the line ";date.timezone=" in php.ini, remove the ";" and change it to "date.timezone = PRC" (PRC: People's Republic of China), restart Apache, problem solved.
Method 2:
In php5 and above versions, to output the local time (China only), you can write the code like this:
PHP code
Copy the code The code is as follows:
date_default_timezone_set('Asia/Shanghai'); s');
?>
You can also write code like this:
PHP code
Copy code The code is as follows:
date_default_timezone_set('Asia/Chongqing');
echo date('Y-m-d H:i:s');
?>
http://www.bkjia.com/PHPjc/318743.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/318743.htmlTechArticleMethod 1: Find the ";date.timezone=" line in php.ini and remove the ";" , change to "date.timezone=PRC" (PRC: People'sRepublicofChina), restart Apache, ask...