Reputation: 1181
How can I find the difference between two SQL timestamp values in minutes and seconds?
Upvotes: 1
Views: 1408
Reputation: 65587
Try the TIMEDIFF() function:
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff
Example:
mysql> select timediff('2010-11-03 15:30:00','2010-11-03 14:00:00') as diff;
+----------+
| diff |
+----------+
| 01:30:00 |
+----------+
Upvotes: 3