I've searched post on stackoverflow,found some similar post.But I think this is a different one.
My PHP & Mysql server's timezone all set to "UTC".
In a table I use a timestamp field,value is "2010-11-08 02:54:15",I use sql like this:
SELECT id,
updated,
second( updated ) ,
unix_timestamp( updated )
FROM `transaction`
where id = 56
Got this:
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");
Got this:
1289184855
The different is 24 seconds.
And I check these timestamps on http://www.unixtimestamp.com/index.php The php result is the correct one. So the mysql unix_timestamp function has bug? Mysql version is: 5.1.41