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?
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.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now