Strtotime () function is a php date function, the problem is that we php.ini in the Date.timezone is not set, as long as the time zone can be configured to resolve.
Php5.1.0 started, php.ini added date.timezone this option, which is turned off by default. The time shown is Greenwich Mean Time, which is 8 hours from Beijing.
Solutions are:
Modify the php.ini file to find the;d Ate.timezone =, remove the preceding semicolon and add the time zone after "=".
Like what:
Asia/chongqing (Chongqing),
Asia/shanghai (Shanghai),
Asia/urumqi (Urumqi),
Asia/macao (Macau),
Asia/hong_kong (Hong Kong),
Asia/taipei (Taipei),
PRC China
Such as
| The code is as follows |
Copy Code |
Date.timezone = PRC |
It is also possible to add the program page in PHP to the front
| The code is as follows |
Copy Code |
Date_default_timezone_set (' asia/chongqing '); echo Date (' y-m-d h:i:s '); ?> |
Related Recommended Reading
Multiple solutions for 8 hours of time difference in PHP
Http://www.bKjia.c0m/phper/31/42398.htm
PHP Date Difference 8 hours Solution
Http://www.bKjia.c0m/phper/31/37224.htm
PHP gets server time (solves 8-hour gap problem)
Http://www.bKjia.c0m/phper/31/34041.htm
http://www.bkjia.com/PHPjc/633215.html www.bkjia.com true http://www.bkjia.com/PHPjc/633215.html techarticle Strtotime () function is a php date function, the problem is that we php.ini in the Date.timezone is not set, as long as the time zone can be configured to resolve. php5.1.0 start, php.ini riga ...