When obtaining the system time, it is found that the obtained time is inconsistent with the system time. When echo $ showtime = date ("Y-m-d H: I: s") is used to obtain the system time today, it is found that 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 ").
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.