resparkman1 Posted April 2, 2023 Posted April 2, 2023 Hello, I have this prepared statement on my code: $insert = "INSERT INTO user (user_id, name, date_in, time_in) VALUES (?, ?, CURRENT_DATE, CURRENT_TIME)"; I tested on xampp (localhost) and the value that is inserted on time_in column every time i run this prepared statement is the same as my local time, however I notice when I tried it here on heliohost and check my database, the inserted values for time_in column is different from my time. My question is how can I change the timezone of the database so that the time that would be inserted on time_in column is similar to my local time? Quote
wolstech Posted April 2, 2023 Posted April 2, 2023 Server uses UTC for all time-related functions. You can try using the " SET timezone='timezone' " command before running the query (see the documentation for a list of time zones), but I'm not sure if it'll work or not. Quote
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.