What MySQL Returns for TIMEDIFF Function with Date Components



MySQL would return the output in time value after converting the difference between date-and-time values being provided to TIMEDIFF() function as arguments.

Example 

mysql> Select TIMEDIFF('2017-10-22 04:05:45', '2017-10-21 03:04:44')AS 'Difference in Time';
+--------------------+
| Difference in Time |
+--------------------+
| 25:01:01           |
+--------------------+
1 row in set (0.00 sec)

Here in this example, we can see that MySQL converts the difference in date-and-time values into time values and return the output in time value as well.

Updated on: 2020-06-20T06:28:42+05:30

90 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements