Home > Database > Mysql Tutorial > body text

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

王林
Release: 2023-09-02 20:49:02
forward
1171 people have browsed it

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)
Copy after login

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!

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