在php5以及起以上的版本,默認情況下的時間會與本地時間出現時差,解決方法如下: 1、在代碼中增加如下命令:<?php date_default_timezone_set('Asia/Shanghai');?> 2、配置php.