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

PHP about time zone issues, PHP time zone issues_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:45:59841browse

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...
Statement:
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