Declaration
TIMESTAMP(expr)
TIMESTAMP(expr1,expr2)
Description
The first statement declares the datetime value of the date-time expression expr.
The second statement declares a date-time expression expr1 plus a time expression expr2, returning a date-time expression. 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