系统时间比Apache时间戳不同 - ? [英] system time is different than apache timestamp --?

查看:306
本文介绍了系统时间比Apache时间戳不同 - ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是个开发服务器上。当我做这在PHP中:

Im on a development server. When i do this in php:

echo date('r',time());

响应:周二,2010年6月1日十八时10分32秒-0400

不过,我的电脑的时间是17点10分32秒(格林尼治标准​​时间上的IM -5)。其中,配置我的Apache / PHP来更改此设置?我看着在php.ini和httpd.conf中了。

However, my computer's time is 17:10:32 (im on GMT -5). Where do i configure my apache/php to change this setting? i've looked in php.ini and httpd.conf already.

感谢

推荐答案

修改的php.ini 文件,并添加以下code在日期部分

Edit your php.ini file and add the following code in the Date section

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/Guayaquil

这将决定时区为所有的PHP页面。

That will define the timezone for all your php pages.

这篇关于系统时间比Apache时间戳不同 - ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆