Skip to main content
Version: V1.0.0

SUBTIME

Syntax

SUBTIME(expr1,expr2)

Description

Returns the difference between the time or datetime expression expr1 and the time expression expr2. The result is formatted in the same way as expr1.

Examples

SELECT SUBTIME('2021-07-14 19:12:59.999999','1 1:1:1.000002');
+--------------------------------------------------------+
| SUBTIME('2021-07-14 19:12:59.999999','1 1:1:1.000002') |
+--------------------------------------------------------+
| 2021-07-13 18:11:58.999997 |
+--------------------------------------------------------+
1 row in set (0.000 sec)