Returns the current timestamp of the database server. This function is an additional function of MaxCompute V2.0.
Syntax
timestamp current_timestamp()
Return value
A value of the TIMESTAMP type is returned.
Examples
Obtain the current time. Sample code:
set odps.sql.type.system.odps2=true;
select current_timestamp();
The following result is returned:
Note
If the millisecond part is 000, the millisecond part in the returned value is 0. If the millisecond part is x00, the millisecond part in the returned value is x. If the millisecond part is xx0, the millisecond part in the returned value is xx.
+------------+
| _c0 |
+------------+
| 2024-06-05 13:37:21.001 |
+------------+
Related functions
CURRENT_TIMESTAMP is a date function. For more information about functions related to date computing and conversion, see Date functions.