Wednesday, April 17, 2013

change date.timezone in php

Open php.ini file and search for date.timezone directive. It should look something like this:

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

or you can use the ini_set() function. Just add at top of your script:

ini_set('date.timezone', 'America/New_York'); 

Here is a list of time zones: http://php.net/manual/en/timezones.php

No comments:

Post a Comment