I am developing a site locally, when a user registers on the website the current date and time is stored in a TIMESTAMP
column, but if I do time()
in my php script the time is 2 hours late compared to the timestamp column!
So for example I registered around 30mins ago, and the time in the database column is 08/31/2016 18:23:12
, and in my php script if I echo time()
now I get 08/31/2016 16:51:22
(when turned into a readable date format). I was expecting to get 08/31/2016 18:51:22
Why do the times differ since it's the same local server? I don't care about timezones for this particular problem, I just want the mysql timestamp and php time()
to be the same "zone".