Home > Backend Development > PHP Tutorial > PHP的时间显示有关问题

PHP的时间显示有关问题

WBOY
Release: 2016-06-13 13:32:00
Original
825 people have browsed it

PHP的时间显示问题
当我输入如下语句时
echo date("Y-m-d H:i:s")."";
echo time()."";

?>
运行程序显示的时间与我电脑当前显示的时间不一致,求解!

------解决方案--------------------
时区?
------解决方案--------------------

PHP code

date_default_timezone_set('Asia/Hong_Kong');
或
date_default_timezone_set('Asia/ShangHai');
//至今未发现和北京时间一样的 <div class="clear">
                 
              
              
        
            </div>
Copy after login
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