easy php date configuration

1.8k Views Asked by At

i am running easyPHP on localhost in windowsXP

right now its

2011-02-07 19:46:00

but when i try a the PHP function date() it gives me:

2011-02-08 12:43:00

does anybody knows how to configurate this?

4

There are 4 best solutions below

3
On BEST ANSWER
0
On

Changing the file binaries\apache\conf\httpd.conf on following php_value date.timezone did the trick for me:

# PHP Timezone
<IfModule mod_php5.c>
  php_value date.timezone "America/Godthab"
</IfModule>
0
On
date_default_timezone_set('EST');

Your timezone like suggested was incorrect. It can be changed through php.ini, however a simple addition to the code itself would be more ideal if php.ini is inaccessible or you just want to be safe about stuff.

Give it a try, let me know if it works. EST may be something different but it seems about right -5:00 GMT?

Good luck! :)

0
On

So after toying about with this exact issue for quite some time myself, I came to the following solution. If the rest do not work for you, try the painfully slow and tedious way.

Look for any files named php.ini or httpd.conf in your EasyPHP install folder. In each of these files make sure the following line has your preferred time zone.

date.timezone = America/New_york

This will work. For me it was one of the httpd.conf files that was overriding my php.ini file. This can make things difficult to detect.