Home >Database >Mysql Tutorial >What will MySQL return if we include the date part and the time part as arguments to the TIMEDIFF() function?

What will MySQL return if we include the date part and the time part as arguments to the TIMEDIFF() function?

WBOY
WBOYforward
2023-08-26 16:25:021208browse

如果我们将日期部分和时间部分作为 TIMEDIFF() 函数的参数包含在内,MySQL 将返回什么?

After converting the difference between the date and time values ​​supplied as arguments to the TIMEDIFF() function, MySQL returns the output of the time value.

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)

In this example, we can see that MySQL converts the difference of date and time values ​​into a time value and Returns the output as a time value.

The above is the detailed content of What will MySQL return if we include the date part and the time part as arguments to the TIMEDIFF() function?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete