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

PHP的时间显示有关问题

WBOY
WBOYOriginal
2016-06-13 13:32:00794browse

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>
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