Finally, I found the answer ~~~~
From CC Spiderman's blog
From php5.1.0, the date. timezone option is added to PhP. ini, Which is disabled by default.
That is, the displayed time (no matter what php Command is used) is the Greenwich Mean Time.
The difference between the time and our time (Beijing time) is exactly 8 hours. In the following three ways, we can restore the normal time.
1. The simplest method is not to use php5.1 or a later version.
2. If it must be used and PHP. ini cannot be modified
Add date_default_timezone_set (XXX );
CP does not have this problem
3. Once and for all, only Php. ini can be modified. Open PHP. ini and find date. timezone. Remove the semicolon.
= Add XXX to the backend and restart the HTTP service (such as apache2 or IIS ).
For XXX, the available values in mainland China are: Asia/Chongqing, Asia/Shanghai, Asia/Urumqi (Chongqing, Shanghai, and Urumqi in sequence)
Available in Hong Kong and Taiwan regions: Asia/Macao, Asia/hong_kong, Asia/Taipei (in the order of Macao, Hong Kong, and Taipei)
Singapore: Asia/Singapore
Foreigners seem to have missed Beijing
Other available values are: ETC/GMT-8, Singapore, Hongkong, PRC
What is PRC? PRC is the People's Republic of China -_-
The above are all my documents from the PHP official documents to sort out the GMT-8 below the area, there may be omissions
You can check more regions on http://www.php.net/docs.php
Since the program will eventually convert the place name to the time zone for calculation, when you are not using the built-in area, the program will automatically use the Greenwich Mean Time |