The default is off, just remove the comment and change it to
where PRC is "People's Republic of China"! Other options can be found in the PHP manual. The Asian region omits Beijing and MGB. If you do not have permission to modify php.ini, you only need to call date_default_timezone_set(' when calling the time and date function PRC') and that's it! You can also call date_default_timezone_get() to view the current time zone setting! Regarding XXX, the available values in mainland China are: Asia/Chongqing, Asia/Shanghai, Asia/Urumqi (in order Chongqing, Shanghai, Urumqi) Available in Hong Kong and Taiwan: Asia/Macao, Asia/Hong_Kong, Asia/Taipei (Macau, Hong Kong, Taipei in order) Taiwan can be set to: date.timezone = "Asia//Taipei" And Singapore: Asia/Singapore Attachment: Solution to the eight-hour time difference in PHP5 The time display of php5.1.2 is 8 hours shorter.
The result is that the difference is 8 hours after my own test. It turns out that in php5 and above versions, to output the local time (only in China), you can refer to the following writing method:
This is also possible :
See wonderful Here’s the result: the eight-hour time difference problem was successfully solved. |