gigagames Posted October 2, 2015 Share Posted October 2, 2015 Hello,how can i change the Timezone from the Database (at PHP?)i try everything i foundet, nothing works -.-Here what i have tried:$db->options(MYSQLI_INIT_COMMAND, "SET time_zone = 'Europe/Berlin'");$db->options(MYSQLI_INIT_COMMAND, "SET time_zone = '+01:00'");$db->query("SET time_zone = 'Europe/Berlin'");$db->query("SET time_zone = '+01:00'");and whit session and global bevor time zone but its still using the server time why ? Quote Link to comment Share on other sites More sharing options...
alein Posted October 3, 2015 Share Posted October 3, 2015 What is the script used in your site Quote Link to comment Share on other sites More sharing options...
gigagames Posted October 3, 2015 Author Share Posted October 3, 2015 $db = new mysqli('localhost', '....', '....', '....'); $db->set_charset("UTF8") THEN I HAVE ADDED ONE OF THE "COMMANDS" FROM THE FIRST POST $stmt = $db->prepare(INSERT INTO ... (A,B,C) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE A = VALUES(A), C = VALUES(C), LastUpdate = NOW(); $stmt->bind_param(iss, ......); $stmt->excecute(); Then if i check in Mysql the Timestamp is convertet to a date, but its a wrong clock, becouse its still use the Time_zone from the server and not my thet i have set Quote Link to comment Share on other sites More sharing options...
alein Posted October 5, 2015 Share Posted October 5, 2015 you can change the Timezone from setting of your script Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.