Syntax
TIMEDIFF(date1, date2)
Purpose
TIMEDIFF calculates the time difference between two datetime values. The function returns a result of the TIME type, representing the time interval between the two points in time, date1 and date2.
The range of values returned by TIMEDIFF is from -838:59:59 to 838:59:59.
Examples
obclient> SELECT
TIMEDIFF('2015-06-06 12:12:12', '2014-06-05 11:11:11'),
TIMEDIFF('2015-06-06 12:12:12', '2015-06-05 11:11:11')
\G
*************************** 1. row ***************************
TIMEDIFF('2015-06-06 12:12:12', '2014-06-05 11:11:11'): 838:59:59
TIMEDIFF('2015-06-06 12:12:12', '2015-06-05 11:11:11'): 25:01:01
1 row in set