Welcome Guest, Not a member yet? Register   Sign In
timezone Error
#1

Hi...

I get timezone error when I publish my site, but I could solve the problem with date_default_timezone_set('America/Sao_Paulo'); in my root index.php. But after do it, I tried set 'America/Sao_Paulo' in $config['time_reference'] = '', but ot works for me.

What the real function $config['time_reference'] = '' of on CI? Thre is another way to set it, whitout change the php.ini?
PHP is Life!!! See My Portfolio
Reply
#2

For Brazil is:

$config['time_reference'] = 'UM3';

More info here:
http://www.codeigniter.com/user_guide/he...-reference

Reply
#3

(06-04-2015, 11:13 AM)davicotico Wrote: For Brazil is:

$config['time_reference'] = 'UM3';

More info here:
http://www.codeigniter.com/user_guide/he...-reference

Even with the new configuration it not works.
PHP is Life!!! See My Portfolio
Reply
#4

(06-04-2015, 12:12 PM)calcio Wrote:
(06-04-2015, 11:13 AM)davicotico Wrote: For Brazil is:

$config['time_reference'] = 'UM3';

More info here:
http://www.codeigniter.com/user_guide/he...-reference

Even with the new configuration it not works.

Sorry,
In the file application/config.php is:
$config['time_reference'] = 'gmt';

In your controllers files is:

$data = now();
echo mdate("%Y-%m-%d %H:%i:%s", gmt_to_local($data, 'UM3'));

Reply
#5

Thanks @davicotito, but it has not worked yet.
I'll stay with my solution.
PHP is Life!!! See My Portfolio
Reply
#6

Did you set it in your php.ini file?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB