This tutorial explains how to use the MySQL TIMEDIFF function with syntax and examples.
The MySQL TIMEDIFF function returns the difference (expressed as a time value) between two time/datetime values.
The syntax for the TIMEDIFF function in MySQL is:
The two time/datetime to calculate the difference between. The calculation is time1 - time2.
The TIMEDIFF function can be used in the following versions of MySQL:
Let's look at some MySQL TIMEDIFF function examples and explore how to use the TIMEDIFF function in MySQL.
For example: