The strtotime() function is a php date function. This problem occurs because the date.timezone in our php.ini is not set properly. It can be solved by configuring the time zone.
Starting from php5.1.0, the date.timezone option has been added to php.ini, which is turned off by default. The displayed time is all Greenwich Mean Time, which is exactly 8 hours different from Beijing time.
The solution is:
Modify the php.ini file, search for ;date.timezone = , remove the semicolon in front and add the time zone after "=".
For example:
Asia/Chongqing (Chongqing),
Asia/Shanghai (Shanghai),
Asia/Urumqi (Urumqi),
Asia/Macao (Macau),
Asia/Hong_Kong (Hong Kong),
Asia/Taipei (Taipei),
PRC China
as
The code is as follows
|
Copy code
|
||||||||
You can also add at the front of the program page in php
http://www.bkjia.com/PHPjc/633215.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/633215.htmlTechArticlestrtotime() function is a php date function. This problem occurs because of the date.timezone in our php.ini It's not set up properly, just configure the time zone to solve it. Starting from php5.1.0, php.ini is rigged... |