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
Release: 2023-08-26 16:25:02
forward
1224 people have browsed it

如果我们将日期部分和时间部分作为 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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template