cancel
Showing results for 
Search instead for 
Did you mean: 
Go to solution
New

How to change TimeZone for MySqL ?

I have economy web hosting plan. My client is based in India, so i want to set default timezone of MYSqL to IST. I tried from PhPMyAdmin, but i am getting Access denied as i am not a super user.

Can anyone suggest any solution?

 

Thanks

vask
2 REPLIES 2
Anonymous
Not applicable

Re: How to change TimeZone for MySqL ?

Solution

Re: How to change TimeZone for MySqL ?

I couldn't find a way to change MySql timezone from cPanel or any Godaddy Configuration.

But I found this solution for my php PDO connection which works just fine


When starting my DB connection, I set the time_zone command in my PDO object e.g.:

$pdo = new PDO($dsn, $user, $pass, $opt);
$pdo->exec("SET time_zone='-4:00';");

Where "-4:00" is the difference beetween my local timezone and London TimeZone 

After that; all the MySQL processes related to Date and Time are set with my timezone