Possible Duplicate:
MySQL: how to get the difference between two timestamps in seconds
How can I get the difference in seconds (or any other unit) between two timestamps? If I use select NOW() - '2012-01-01 00:00:00'
I get 20110121168303
which is wrong.
My favorite solution
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timestampdiff