开发者

system time is different than apache timestamp --?

开发者 https://www.devze.com 2023-01-02 02:42 出处:网络
Im on a development server. When i do this in php: echo date(\'r\',time()); response: Tue, 01 Jun 2010 18:10:32 -0400

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

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

response: Tue, 01 Jun 2010 18:10:32 -0400

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

Thanks


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

That will define the timezone for all your php pages.


To set your server's time-zone add a line to your .htaccess file:

SetEnv TZ America/Indianapolis

For a list of supported timezones:

http://www.php.net/manual/en/timezones.america.php

0

精彩评论

暂无评论...
验证码 换一张
取 消