PHP关于时区问题,PHP时区问题_PHP教程

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

PHP关于时区问题,PHP时区问题

最近在学习PHP过程中发现PHP中的格式化时间戳比北京时间晚了8个小时,上网搜索发现原来是时区不对,解决办法是:

     1、永久修改           更改php.ini文件中的data.timezone = PRC  这是中国时间。重启Apache服务后生效。      2、临时修改           在使用格式化输入时间之前,添加ini_set('date.timezone','Asia/Shanghai');                或者data_default_timezone_set('PRC');//date_default_timezone_set() 函数设置用在脚本中所有日期/时间函数的默认时区。  

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1036014.htmlTechArticlePHP关于时区问题,PHP时区问题 最近在学习PHP过程中发现PHP中的格式化时间戳比北京时间晚了8个小时,上网搜索发现原来是时区不对,解决...
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!