System time is different from apache timestamp -?

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

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

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

However, my computer time is 17:10:32 (im on GMT -5). Where can I configure apache / php to change this setting? I have already looked through php.ini and httpd.conf.

thank

+5
source share
2 answers

Modify your php.inifile and add the following code to the sectionDate

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

This will determine the time zone for all of your php pages.

+4
source

To set the time zone of the server, add a line to the .htaccess file:

SetEnv TZ America/Indianapolis

List of supported time zones:

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

+3

All Articles