PHP日期函数返回错误日期,如何指定我的时区? [英] PHP date function returning wrong date, how can I specify my time zone?
本文介绍了PHP日期函数返回错误日期,如何指定我的时区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<?php echo date('m/d/Y',time());?>
echos
07/13/2013
当它应该回显
07/12/2013
有没有一个服务器配置我应该改变,如果有哪里可以找到它?谢谢我的时区是(UTC-08:00)太平洋时间(美国和加拿大)
Is there a server config I should change and if there is where could I find it? Thank you My time zone is (UTC-08:00) Pacific Time (US & Canada)
推荐答案
查看 date_default_timezone_set :
示例:
date_default_timezone_set('America/Los_Angeles');
这篇关于PHP日期函数返回错误日期,如何指定我的时区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文