Calculate Difference Between Two Time Values in MySQL



With the help of TIMEDIFF() MySQL function the difference between two-time values can be calculated.

Example

mysql> Select TIMEDIFF('04:05:45','03:05:45') AS ‘Difference in Time’;
+---------------------------------+
| Difference in Time              |
+---------------------------------+
| 01:00:00                        |
+---------------------------------+
1 row in set (0.00 sec)
Updated on: 2020-06-20T06:28:18+05:30

215 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements