SUBTIME

2026-04-02 06:23:57  Updated

Syntax

SUBTIME(expr1,expr2)

Purpose

SUBTIME() returns the difference between the time or datetime expression expr1 and the time expression expr2. The format of the return value is the same as expr1.

Examples

obclient> 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

Contact Us