Error saving php mysql schedule

Asked

Viewed 213 times

1

I have a variable to pick the current date and time but this saving with three hours more than the current, someone has been through this problem?

$data = date("d/m/Y H:i:s "); 

2 answers

3

Brazil is in GMT-3, probably the system is configured to save in GMT+0. To fix this, you need to demonstrate the structure of your application to know who is responsible for saving this time. If you are generating the date through PHP, then surely the problem is not with Mysql, but with the application. The time of the computer is right?

You can also use the function gmdate, which returns the same format as date(), but uses the local GTM to return the date.

2

Try to define the Timezone standard to be used in time functions, example Timezone São Paulo:

ini_set('date.timezone', 'America/Sao_Paulo');

or

date_default_timezone_set('America/Sao_Paulo');

See the list of supported timezones

Browser other questions tagged

You are not signed in. Login or sign up in order to post.