ADDTIME

2024-06-28 05:30:31  Updated

Syntax

ADDTIME(expr1,expr2)

Purpose

expr1 is a time or datetime expression, and expr2 is a time expression. ADDTIME() adds expr2 to expr1 and returns the result.

Examples

obclient> SELECT ADDTIME('2022-09-08 23:59:59.999999', '1 1:1:1.000002');
+---------------------------------------------------------+
| ADDTIME('2022-09-08 23:59:59.999999', '1 1:1:1.000002') |
+---------------------------------------------------------+
| 2022-09-10 01:01:01.000001                              |
+---------------------------------------------------------+
1 row in set

obclient> SELECT ADDTIME('01:10:01.999999', '02:01:10.999998');
+-----------------------------------------------+
| ADDTIME('01:10:01.999999', '02:01:10.999998') |
+-----------------------------------------------+
| 03:11:12.999997                               |
+-----------------------------------------------+
1 row in set

Contact Us