简体   繁体   中英

Can't change the Default timezone

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! :)

尝试setLocale的您当前的时区。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM