php time zone setting summary
The code is as follows:
date_default_timezone_set('PRC');
echo date('Y-m-d H:i:s');
?>
1. Modify php.ini, find data.timezone = in php.ini and remove the ; number in front of it, and then set data.timezone = "Asia/Shanghai"; After that, start Apache from;
If this operation is not completed and there is still a time error, open the httpd.conf file in Apache and add PHPIniDir "php.ini path"
2. Use the function ini_set('date.timezone','Asia/Shanghai'); or date_default_timezone_set('Asia/Shanghai'); in the program code of PHP version 5 or above;
Explanation of some commonly used time zone identifiers:
Asia/Shanghai – Shanghai
Asia/Chongqing – Chongqing
Asia/Urumqi – Urumqi
Asia/Hong_Kong – Hong Kong
Asia/Macao – Macau
Asia/Taipei – Taipei
Asia/Singapore – Singapore
http://www.bkjia.com/PHPjc/1056647.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1056647.htmlTechArticlephp time zone setting summary code is as follows: ? date_default_timezone_set(PRC); echo date(Y-m-d H:i:s); ? 1. Modify php.ini, find data.timezone = in php.ini, remove the ; sign in front of it, and then set...
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