All Products
Search
Document Center

MaxCompute:CURRENT_TIMESTAMP

Last Updated:Mar 26, 2026

Returns the current time as a TIMESTAMP value, based on the time zone of the current session or project.

Syntax

TIMESTAMP CURRENT_TIMESTAMP()

-- A standard example.
-- Returns 2025-06-05 13:37:21.123.
SELECT CURRENT_TIMESTAMP();

Parameters

This function takes no parameters.

Return value

Returns a TIMESTAMP value. The time zone follows the session setting (odps.sql.timezone). If no session time zone is set, the project-level time zone applies.

Millisecond display rules: Trailing zeros in the millisecond part are dropped.

Millisecond partDisplayed as
0000
x00x
xx0xx

Examples

The following examples assume the current system time is 2025-06-05 13:37:21.001 (UTC+8).

SET odps.sql.timezone=Asia/Shanghai;
-- Returns 2025-06-05 13:37:21.001.
SELECT CURRENT_TIMESTAMP();

SET odps.sql.timezone=Etc/GMT;
-- Returns 2025-06-05 05:37:21.001.
SELECT CURRENT_TIMESTAMP();

Related functions

CURRENT_TIMESTAMP is a date function. For more information about other date functions, see Date functions.