Well I get CURRENT_TIMESTAMP and compare it with date() function and they are not the same to get more into details.
I do
$sql=mysql_query("UPDATE time SET date=CURRENT_TIMESTAMP" WHERE id='1');
than I retreive the data
$data=mysql_fetch_array($sql);
echo $data;
echo date('Y-m-d H:i:s');

there is a difference of 6 hours. I guess its because php gets time from internet while MYSQL from computer. Anyone knows how to fix this?

This is because default timezone for mysql and php is different.
Check here for mysql timezone and here for php timezone.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.