Originally from php5.1.0, PHP.ini added date.timezone this option, which is turned off by default
That is, the time displayed (whatever PHP command is used) is Greenwich Mean Time
And our Time (Beijing time) The difference is exactly 8 hours, there are the following 3 methods can restore normal time.
1, the simplest way is not to use the version of php5.1 above
2, if must be used, and can not modify the php.ini, it is necessary in relation to the initialization of the time of the statement
Add Date_default_timezone_set (XXX) above;
3, once and for all, can only modify php.ini. Open php.ini Find Date.timezone remove the preceding semicolon
= Add xxx After, restart HTTP service (such as Apache2 or IIS, etc.)
For XXX, the values available in mainland China are: asia/chongqing, Asia/shanghai, Asia/urumqi (Chongqing, Shanghai, Urumqi, respectively)
Taiwan available: Asia/macao, Asia/hong_kong, Asia/taipei (Macau, Hong Kong, Taipei, respectively)
and Singapore: Asia/singapore
The foreigner seems to have missed Beijing's tune.
Other available values are: Etc/gmt-8, Singapore, Hongkong, PRC
What is PRC? PRC is the People's Republic of China Ah-_-