Php is newly installed for the php time zone. date (& quot; Y-m-dH: I: s & quot;); is used to get an 8-hour shorter time than the actual time zone. Obviously, this is a problem with the time zone. how can we adjust it? Method 1: in the php. ini file, modify the settings to find the date. timezone item and modify it to set the date. timezone = Asia/Shanghai using the cgi-side php time zone.
Php is installed.
Date ("Y-m-d H: I: s ");The resulting time is 8 hours less than the actual time. Obviously, this is a problem with the time zone. how can we adjust it?
Method 1
Modify settings in the php. ini file
Locate the date. timezone item and modify its settings.
Date. timezone = Asia/Shanghai
If you run php in cgi mode, remember to restart apache configuration to take effect.
Method 2
If you have permissions or other issues, you can set them in the PHP code.