I want to set a specific folder to another timezone in the php.ini file so I don't have to set it manually in each file within the folder.
[Date]
date.timezone = Europe/Berlin
Folder[Date] /* something like this? */
date.timezone = America/New_York
I want to set a specific folder to another timezone in the php.ini file so I don't have to set it manually in each file within the folder.
[Date]
date.timezone = Europe/Berlin
Folder[Date] /* something like this? */
date.timezone = America/New_York
 
    
    You should be able to use .htaccess to set the default timezone on a per directory basis.
Just add
php_value date.timezone "America/New_York"
to an .htaccess file in that directory and make sure your server supports per directory configuration.
 
    
    Use date_default_timezone_set in the scripts in that folder.
You can also set it in htaccess:
php_value date.timezone "America/New_York"
For this to work, you need to use mod_php in Apache. See also this question.
You can probably also use in the .htaccess file:
SetEnv TZ America/New_York
Which should work on every system, php_value may not work on certain servers. But I would really recommend using the normal php function:
date_default_timezone_set('America/New_York');
http://php.net/manual/en/function.date-default-timezone-set.php
in a specific file that has the configuration specific to your script, and then just include the file in your other files.
 
    
    These answers are all correct when using a webserver, however this doesn't work running a PHP CLI script, for ie. a cronjob. PHP would use the date.timezone setting defined in php.ini.
Best practice would be, to just call date_default_timezone_set on top of your application wrapper/bootstrap file.
date_default_timezone_set('America/New_York');
