Welcome Guest, Not a member yet? Register   Sign In
Setting the timezone for codeigniter
#1

[eluser]vamsee[/eluser]
I got warning messages for not setting the date_default_timezone in php.ini.

But I took care of it by modifying the main index.php.

Instead if the codeigniter itself if take care of setting the environmental timezone then it would be better.

following is code added in main index.php

Code:
if( !ini_get('date.timezone') )
{
    date_default_timezone_set(date_default_timezone_get());
}
#2

[eluser]Unknown[/eluser]
Yeh, I've come upon this issue too in the past. I did a similar thing to you and were surprised that it's not a native config setting in codeigniter
#3

[eluser]Daniel Moore[/eluser]
CodeIgniter assumes you've got this set in your main PHP.INI file. Checking that item before actually setting it is definitely the way to go, in case you end up installing on a server at some point that has it set already.
#4

[eluser]InsiteFX[/eluser]
PHP 5.3 will complain with out the timezone setting just add it to index.php

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB