date.timezone in php.ini for php5

My last post about glitch in time related function for php5 I use a function date_default_timezone_set

For global setting as always use date.timezone in php.ini

just change from :

;date.timezone =Asia/Jakarta

uncomment it first by remove semicolon mark into this :

date.timezone =Asia/Jakarta

save php.ini files and restart apache

try view using phpinfo()

 date.timezone in php.ini for php5

you’re done icon smile date.timezone in php.ini for php5

6 Comments

  • Gaurav
    July 8, 2008 - 8:34 am | Permalink

    Thanks .. this helps me a lot.
    During the installation of zabbix server

  • radzeen
    July 29, 2008 - 12:04 pm | Permalink

    Thanks.This is a very usefull article to control localhost timezon setting.

  • Petition
    March 5, 2009 - 6:54 am | Permalink

    I have modified as per above suggesstion and I am able to see updated info in phpinfo() but when I try date function function it gives server time, used settings are:

    date.timezone = Asia/Kolkata

    Local time is March 5, 2009, 12:23 pm

    and echo(date(‘F j, Y, g:i a’)); gives me – March 5, 2009, 1:54 am

    Any idea why this is happening?

  • sam
    April 13, 2009 - 8:33 am | Permalink

    hi
    I have installed PHP 5.2.0-8+etch13 on my debian server and set the time of a server to Asia/Tehran +03:30 IRDT, but php time is set to Asia/Tehran +03:30 IRST and as a result php and mysql time are mismatch.
    I uncommented date.timezone and set it o Asia/Tehran IRDT but it didn’t have any effect!
    how should I do to set php time to Asia/Tehran +03:30 IRDT?
    thanks

  • tr2bnc
    December 8, 2009 - 9:58 am | Permalink

    Thanks it helped me!

  • yuyu
    May 30, 2010 - 2:29 am | Permalink

    Very useful, thanks for sharing!

  • Comments are closed.