How can I get difference of two dates through MYSQL select query
H开发者_如何学编程ow can I get difference of two dates (up to seconds precision) through MYSQL select query.
Can some one guide me in this regards.
Returns the difference in seconds between two dates.
SELECT TIME_TO_SEC(TIMEDIFF('2007-01-09 10:24:46','2007-01-09 10:23:46'));
You can use DATEDIFF()
or TIMEDIFF()
http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html
精彩评论