这个动态获取服务器时间为什么和正常时间差8个小时,该如何解决

WBOY
Release: 2016-06-13 13:36:45
Original
1279 people have browsed it

这个动态获取服务器时间为什么和正常时间差8个小时
问题如上所述,已仔细看过代码,新手求指教!代码如下


 
 
 


 
 
 
 
 
 
 
 
 
 

------解决方案--------------------
如果你确认代码没问题 刚好差了8个小时,那么 服务器php.ini 添加 date.timezone = "Asia/Chongqing"

restart apache.
------解决方案--------------------
默认的格林时间比正常时间早8小时。 改改时区设置即可。
------解决方案--------------------
php.ini 添加 date.timezone = "Asia/Chongqing"
------解决方案--------------------
在程序最前边加上一句话:date_default_timezone_set('PRC');
Related labels:
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!