I’m using the timestamp data type in MySQL so that any timestamp saved will be converted into GMT, then back from GMT on retrieval. From the documentation, it seems like this is all automatically done for me by MySQL; all I need to do is use the timestamp data type.
However, I noticed that it doesn’t seem to work. I’ve tested this on my local machine and server — and it seems that it always saves the local time instead of GMT. The local machine and server are in different time zones and neither are in GMT.
Here’s my test insert:
INSERT INTO `test` (`test_id`, `stamp`) VALUES (NULL, CURRENT_TIMESTAMP);
Any ideas what I’m doing wrong?
try to access your database using mysql terminal
1) first enter this code
SET time_zone = '+00:00';2) then now do your SELECT to check your data
You can access your mysql by using the follwing the method in this link.
How can I access the MySQL command line with XAMPP for Windows?
I hope you would understand it in your case
NOTE:
timestamps automatically converted in the timezone adjusted for any client connected on mysql. so you can’t really see its original time but it always depends on your set timezone