Home > Backend Development > PHP Tutorial > PHP about time zone issues, PHP time zone issues_PHP tutorial

PHP about time zone issues, PHP time zone issues_PHP tutorial

WBOY
Release: 2016-07-13 09:45:59
Original
873 people have browsed it

PHP about time zone issues, PHP time zone issues

Recently, while learning PHP, I discovered that the formatted timestamp in PHP is 8 hours later than Beijing time. After searching online, I found that The time zone is wrong, the solution is:

1. Permanent modification ​ ​ ​ ​Change data.timezone = PRC in the php.ini file This is China time. It will take effect after restarting the Apache service. 2. Temporary modification                                                                                                             Added ini_set('date.timezone','Asia/Shanghai'); ​ before using formatted input time. Or data_default_timezone_set('PRC');//date_default_timezone_set() function sets the default time zone used for all date/time functions in the script.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1036014.htmlTechArticlePHP Regarding time zone issues, PHP time zone issues. Recently, in the process of learning PHP, I found that the formatted timestamp in PHP is faster than Beijing The time is 8 hours behind. I searched online and found that the time zone is wrong. The solution...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template