Home  >  Article  >  Database  >  How to calculate the difference between two time values ​​in MySQL?

How to calculate the difference between two time values ​​in MySQL?

王林
王林forward
2023-09-02 20:49:021156browse

MySQL 中如何计算两个时间值之间的差异?

With the TIMEDIFF() MySQL function, you can calculate the difference between two time values.

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)

The above is the detailed content of How to calculate the difference between two time values ​​in MySQL?. 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