I store times in MySQL sent from a PHP script as CURRENT_TIMESTAMP. This makes times from the wrong timezone, minus 1 hour from where I am. I’m not superuser, so SET GLOBAL time_zone = 'Europe/London'; won’t work. Is there anyway I can modify the input or output query to compensate 1 hour?
This is my current sql query, sent from a form:
REPLACE INTO `order_admin_message` (`order_id`, `message`, `date_updated`)
VALUES ('$number', '$msg', CURRENT_TIMESTAMP)
And then I retreive it using:
SELECT order_admin_message.message, order_admin_message.date_updated
FROM order_admin_message
WHERE order_admin_message.order_id = $number
EDIT: To be clear, I don’t want to show the user’s time, just local London time (taking daylight saving into account in summer).
EDIT 2: Changed the subject to be closer to the question/answer.
In PHP, just change it for your display. Don’t store locale dependent dates or times in a database. Makes conversion later on, a PITA. Just display the time/timezone you need even if you don’t care about the user.