My MySQL database is saving the time users register on my website using CURRENT_TIMESTAMP. THe thing is that it is the hosts timezone which is completely different from the one the website is used in. Is there any way to change the timezone in MySQL?
Asked
Active
Viewed 56 times
1
-
1You are looking in the wrong direction... And yes there is a way, but it involves changing the timezone of your server.. – Naruto Sep 28 '15 at 13:12
-
possible duplicate of [MySQL timezone change?](http://stackoverflow.com/questions/3451847/mysql-timezone-change) – al'ein Sep 28 '15 at 13:15
-
Try saving time stamp in UTC form, that might help.. – MarmiK Sep 28 '15 at 13:16
-
use this `SET time_zone = timezonename;` – Payer Ahammed Sep 28 '15 at 13:19
1 Answers
1
To set a value for it use either one:
SET time_zone = 'Europe/Helsinki';
SET time_zone = "+00:00";
SET @@session.time_zone = "+00:00";

Payer Ahammed
- 887
- 1
- 5
- 16