PHP time () to get a lot different from the current time, check the php.ini, found that the time zone is wrong. In PHP.ini, the current setting is:
[Date]
; Defines the default timezone used by the date functions
; Http://php.net/date.timezone
Date.timezone = Europe/paris
; Http://php.net/date.default-latitude
Date.default_latitude = 48.88778
; Http://php.net/date.default-longitude
Date.default_longitude = 2.31806
That is the current time to use Europe Paris, now we change it to Shanghai time
[Date]
; Defines the default timezone used by the date functions
; Http://php.net/date.timezone
Date.timezone = Asia/shanghai
; Http://php.net/date.default-latitude
Date.default_latitude = 31.5167
; Http://php.net/date.default-longitude
Date.default_longitude = 121.4500
Save php.ini After modification, then restart service
The time function returned by PHP is incorrect