How to set php timezone: first find and open the "php.ini" file; then modify the value of "date.timezone" with the statement "date.timezone=Asia/Shanghai"; finally restart the web server. Can.
Recommended: "PHP Video Tutorial"
Time zone setting date.timezone## in PHP
#For the same timestamp, if the time zone is different, the obtained date and time string will also be different. Therefore, setting the correct time zone is essential. Different time zones will affect the value of date('Y-m-d H:i:s', time()) or similar functions. There are two ways to set the time zone: 1. Modify the value of date.timezone in the configuration file php.inidate.timezone=Asia/Shanghai
date.timezone=Asia/Chongqing
bool date_default_timezone_set ( string $timezone_identifier )
date_default_timezone_set( 'Asia/Shanghai' );
The above is the detailed content of How to set up php timezone. For more information, please follow other related articles on the PHP Chinese website!