Syntax
TIMESTAMP(expr)
TIMESTAMP(expr1,expr2)
Purpose
The first syntax returns the datetime value of the datetime expression expr.
The second syntax returns the datetime value of the datetime expression expr1 plus the time value of the time expression expr2. If expr2 contains a date, only the time value is taken.
If any parameter is NULL, the function returns NULL.
Examples
obclient> SELECT TIMESTAMP('2020-12-31');
+----------------------------+
| TIMESTAMP('2020-12-31') |
+----------------------------+
| 2020-12-31 00:00:00.000000 |
+----------------------------+
1 row in set
obclient> SELECT TIMESTAMP('2020-12-31 12:00:00','12:00:00');
+---------------------------------------------+
| TIMESTAMP('2020-12-31 12:00:00','12:00:00') |
+---------------------------------------------+
| 2021-01-01 00:00:00.000000 |
+---------------------------------------------+
1 row in set
