I was looking for a message on stackoverflow, found some similar messages. But I think this is different.
My PHP and Mysql server time zone is set to "UTC".
In the table, I use the timestamp field, the value is "2010-11-08 02:54:15", I use sql as follows:
SELECT id, updated, second( updated ) , unix_timestamp( updated ) FROM `transaction` where id = 56
Gets the following:
id updated second unix -------------------------------------------- 56 2010-11-08 02:54:15 15 1289184879
Then I use this in php:
echo strtotime("2010-11-08 02:54:15");
Gets the following:
1289184855
The difference is 24 seconds.
And I will check these timestamps at http://www.unixtimestamp.com/index.php The php result is correct. So does mysql unix_timestamp function have an error? Mysql Version: 5.1.41
source share