TIMEDIFF returns the difference between two time expressions.
SELECT TIMEDIFF(“13:10:11”, “13:10:10”); |
The TIMEDIFF() function calculates the difference between two time or datetime expressions.
Note: time1 and time2 must be in the same format, and the calculation performed is time1 – time2.
TIMEDIFF(time1, time2) |
Parameter |
Description |
time1 |
Required: A time value |
time2 |
Mandatory: A time value |
Works in: |
From MySQL version 4.0 |
Calculate the difference between two datetime expressions.
SELECT TIMEDIFF(“2017-06-25 13:10:11”, “2017-06-15 13:10:10”); |