All Products
Search
Document Center

Date and time operators

Last Updated: Jun 18, 2021

The following table lists all date and time operators.

Operator

Operand

Description

+

Binary

The same as the DATE_ADD function.

-

Binary

The same as the DATE_SUB function.

Examples

OceanBase (root@oceanbase)> SELECT '2008-12-31 23:59:59' + INTERVAL 1 SECOND;
+-------------------------------------------+
| '2008-12-31 23:59:59' + INTERVAL 1 SECOND |
+-------------------------------------------+
| 2009-01-01 00:00:00                       |
+-------------------------------------------+
1 row in set (0.01 sec)