I have field with type (timestamp) and default CURRENT_TIMESTAMP, the date is correct when I browsing records with phpMyAdmin but when I tried to display it by PHP file it displayed incorrect date
date in MySQL 2017-07-05 10:28:12
date in PHP 2017-06-23 09:51:31
using below query
SELECT u.date FROM table u
the global time zone of MySQL server is (SYSTEM) and I didn't change
PHP code
<?php
include("../config.php");
$sql = mysql_query("sql query");
var_dump(mysql_fetch_array($sql));
?>
Any support?
SOLUTION
If you face this problem you have to do the following:
Instead of mysql use PDO or mysqli_* functions and this will solve the problem without setting timezones either in your MySQL server or PHP files.

