Talk:Running web scripts in your Timezone

presented solution vs. PHP version
This subject should be expanded with information how it depends on the version of PHP run for a website. On the server yoohoo.dreamhost.com both with 4.4.7 (PHP_SAPI = cgi) and 5.2.2 (PHP_SAPI = cgi-fcgi) the variable TZ set in .htaccess doesn't get passed. Only putEnv('TZ=America/Argentina/Buenos_Aires') worked for me.

--User:Cezary_Okupski 17 July 2007

Do you have to do this within the PHP script? or in the  file?

Feel free to edit the page and add the solution that works in your context... the idea of the wiki is that each one is able to edit existing pages (without vandalizing, of course)

--Baby 07:32, 31 August 2007 (PDT)

I'm actually using php5 on my domain (set from control panel, so no custom php), and the solution in this article doesnt work. I'd like to avoid having to compile my own php for now, so is there a way through .htaccess to set a different time zone for my whole domain, with php5 running?

Probably a simple option in control panel would be the best thing.

--Dukessa 04:35, 21 June 2008 (UTC)

I was able to resolve this issue in php 5.3 by adding the following line to the phprc file: date.timezone = America/New_York. This allows apps on my VPS to display east coast time instead of west coast time. Having the setting in the phprc file override the settings in php.ini. If you have the need to learn more about how to create or edit phprc files search this wiki for more information.