According to this, if your mysql column is of type TIMESTAMP
, the date time is stored in UTC: it will be converted from local timezone while inserting and retrieving.
To check what the default timezone for MySQL is, try this:
SELECT @@system_time_zone;
PHP's date
function returns the formatted date string from the current unix timestamp. It will use the current default timezone to format the timestamp. You can get the default timezone with this:
echo date_default_timezone_get();
From what I understand from your question's example, these two timezones must be different, or they would show the same time.
I believe it is standard practice to set all the default timezones to UTC, and convert them to local timezone according to the request's origin. Doing this is not as straight forward as it seems, as timezones are not part of the HTTP spec, but this may help you with that: How to detect user's timezone?.
If you just want to store everything in your local timezone and are confident the users won't mind, you can change the default timezone in php and mysql to your local timezone.
MySQL: How do I set the time zone of MySQL?
PHP: http://php.net/manual/en/function.date-default-timezone-set.php