web of unni

About | GuestBook | Add WebOfUnni to Google ToolBar

Download Day

May 12, 2008

Changing time zone in php info page

Filed under: php, time zone — unni @ 5:39 pm

The “precedence order” of the time zone in php is like below :
=============================================================
* The timezone set using the date_default_timezone_set() function (if any)
* The TZ environment variable (if non empty)
* The date.timezone ini option (if set)
* “magical” guess (if the operating system supports it)
* If none of the above options succeeds, return UTC
================================================================

So if you need a custom time zone in the php info page which is returned by the phpinfo function then follow the below steps :

1. Find the php.ini file

#php -i | grep php.ini

2. add the below line to it

date.timezone=Asia/Calcutta

You can get more supported time zone from

компютриhttp://in.php.net/manual/en/timezones.php

3. Save the file and restart webserver, in most cases Apache

#service httpd restart

Thats All :-)

Created and maintained by Unnikrishnan
Hosted by Host cats