What should I do if the Date acquisition time in PHP is incorrect. Today, when we use echo $ showtimedate (Y-m-dH: I: s) to obtain the system time, we find that the obtained time is inconsistent with the system time. After some research, we found that the default time set for PHP is to obtain the system time using echo $ showtime = date ("Y-m-d H: I: s") today at Greenwich Mean Time, the obtained time is inconsistent with the system time.
After some research, we found that the default time set by PHP is based on Greenwich Mean Time zone, so we must change the time zone of PHP to Beijing time.
Operation method:
Open the php. ini file, usually in the PHP installation root directory
Find the; date. timezone
Delete The Semicolon before date. timezone and change it to date. timezone = PRC.
Save the disk and restart the Apahce service (sometimes there is a problem with the Apache restart function. we recommend that you stop and start again)
Let's repeat echo $ showtime = date ("Y-m-d H: I: s ").
Is the time back to normal?
Minute ("Y-m-dH: I: s") to obtain the system time, it is found that the acquisition time does not match the system time. After some research, we found that the default PHP time is Greenwich Mean Time...