All Products
Search
Document Center

Date and time operators

Last Updated: Dec 31, 2019

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.

Example:

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