Mysql Time Difference Function
Mysql Time Difference Function is used to find the time difference between any two dates.
Understand with Example
The Tutorial describe an example that helps you to understand 'Mysql Time Difference Function'. In this example we use TimeDiff('Year1 Time1', 'Year2 Time2') query that return you the time difference between any two consecutive dates.
TimeDiff('Year1 Time1', 'Year2 Time2') : The Query performs the time difference between any consecutive dates.
Query to Time Difference Function
mysql> SELECT TIMEDIFF('2009:01:08 00:00:00', '2008:01:01 00:00:00.000001'); +---------------------------------------------------------------+ | TIMEDIFF('2009:01:08 00:00:00', '2008:01:01 00:00:00.000001') | +---------------------------------------------------------------+ | 8951:59:59.999999 | +---------------------------------------------------------------+ 1 row in set (0.00 sec) |