One question about the PHPdate () function today, when I checked the php manual, I found that the date function can directly pass the parameter Z. The php Manual explains that date (Z) is the time difference offset in seconds. The time zone offset to the west of UTC is always negative, and the time zone offset to the east of UTC is always positive. But I will execute the following code: PHPcode & lt ;? Phpechodate (Y-m-dH: I: s, time (); output a question about the PHPdate () function
When I checked the php Manual today, I found that the date function can directly transmit the parameter Z. The php Manual explains that date ('Z') is the time difference offset in seconds. The time zone offset to the west of UTC is always negative, and the time zone offset to the east of UTC is always positive. But I will execute the following code:
PHP code
In principle, it is 8 hours behind each other. why is the output of 8 in date ('Z')/3600 0?
------ Solution --------------------
The output is 8.
If your time zone is not modified, it should be 0
Echo date ('yz')/3600;
Echo gmdate ('yz')/3600;
If the two outputs are the same, your time is Greenwich Mean Time.
------ Solution --------------------
Because you have not set the local time zone, if you set date. timezone in php. ini or use date_default_timezone_set ()
Specifies the local time zone and the result is 8.
------ Solution --------------------
You use the default green time. Therefore, the echo date ('Z') offset returns 0.