In PHP5, the time difference is 8 hours. Method 1: Find php. "; date. in the timezone line, remove ";" and change it to "date. timezonePRC "(PRC: PeoplesRepublicofChina People's Republic of China), restart Apache, Method 1:
Find php. "; date. timezone = "this line, remove"; "and change it to" date. timezone = PRC "(PRC: People's Republic of China), restart Apache, and solve the problem.
Method 2:
In php5 and later versions, to output local time (only in China), you can write the code like this:
PHP code
The code is as follows:
Date_default_timezone_set ('Asia/Shanghai ');
Echo date ('Y-m-d H: I: s ');
?>
You can also write the code as follows:
PHP code
The code is as follows:
Date_default_timezone_set ('Asia/Chongqing ');
Echo date ('Y-m-d H: I: s ');
?>
Locate php. "; date. timezone = "this line, remove"; "and change it to" date. timezone = PRC "(PRC: People's Republic of China), restart Apache, ask...