bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL TIMEDIFF() Function

Example

SELECT TIMEDIFF("13:10:11", "13:10:10");

Definition and Usage

The TIMEDIFF() function returns the difference between two time/datetime expressions.

Note

time1 and time2 should be in the same format, and the calculation is time1 - time2 .

Syntax

TIMEDIFF(
time1
,
time2
)

Parameter Values

ParameterDescription
time1Required. A time value
time2Required. Another time value

Technical Details

Works in:From MySQL 4.0

Previous

MySQL TIME_TO_SEC() Function

Next

MySQL TIMESTAMP() Function