Save Date to UTC Table Brazil

1

I'm doing an insert into a MySql table that contains multiple date fields.

I left the current_timestamp value in the created_at column of the table.

If I do an INSERT now, it's inserting: 12:29:00. That is, three more hours.

And if I do the INSERT in this column manually by Laravel, like this:

$model->created_at = date('Y-m-d H:i:s')

He also inserts three hours more.

How do I fix this?

    
asked by anonymous 01.07.2016 / 14:30

2 answers

2

You can go to config/app , and change timezone :

'timezone' => 'America/Sao_Paulo',

I think this already solves your problem, I leave here the list of American timezones, I think it should be some of those you want

    
01.07.2016 / 14:35
2

One way to solve this globally is to set the appropriate timezone (America_Sao_Paulo) in php.ini.

Look for or create this line in php.ini and restart apache after the change.

date.timezone=America/Sao_Paulo
    
01.07.2016 / 14:33