0
votes

I use http://www.webhostingpad.com/ for hosting my website, but I really need to change the default timezone to Europe/Tallinn time. I wrote to them and they said that they can't change it for me.

So I tried date_default_timezone_set('Europe/Tallinn'); but the php.ini overrides it or smth. Because if I checked the phpinfo it still had "America/Chicago" or smth.

I also can't change the php.ini file, but I made a copy of it and add it to directory where I can change it. Added date.timezone = "Europe/Tallinn" and also tried ini_set('date.timezone', 'Europe/Tallinn'); It changed the default timezone in phpinfo, but if in mysql database I use: on update CURRENT_TIMESTAMP

And it adds the date still 8 hours wrong.

Does any one have any suggestion how to fix this?

UPDATE:

As anything didn't lead to solution and my service provider said: if you upgrade your contract, then you can change the mySQL timezone.

So now I'm trying to get some result by adding current datetime with php.

INSERT INTO points  (user_id, game_id, points, dateRight) VALUES($userid, $game, $points, sysdate()+3600)");

<< This didn't help. Can anybody help? Thanks! :)

2
have you tried this?? ini_set('date.timezone', 'Europe/Tallinn');swapnesh
ok..then you need to check your mysql Server Time Zone ..check this link dev.mysql.com/doc/refman//5.5/en/time-zone-support.htmlswapnesh
Tried: SET time_zone = '+2:00'; Didn't worked for me. And for: SET GLOBAL time_zone = '+2:00'; - Access denied; you need the SUPER privilege for this operationAlgeron

2 Answers

0
votes

Try to setlocale your current timezone.

0
votes

you can set php default timezone with date_default_timezone_set, for mysql look here

Why mysql because, timestamp on update current_timestamp uses mysql default timezone.