All Products
Search
Document Center

MaxCompute:CURRENT_TIMESTAMP_NTZ

Last Updated:Mar 25, 2026

Returns the current time in a specified time zone as a TIMESTAMP_NTZ value, accurate to the millisecond.

Syntax

TIMESTAMP_NTZ CURRENT_TIMESTAMP_NTZ([STRING <time_zone>])

Quick example — returns the current UTC timestamp:

-- Returns 2025-11-05 06:26:37.136
SELECT CURRENT_TIMESTAMP_NTZ();

Parameters

ParameterRequiredTypeDefaultDescription
time_zoneNoSTRINGUTCThe time zone for the returned timestamp. Accepts three formats: IANA time zone name (e.g., Asia/Shanghai), UTC offset with minutes (e.g., UTC+08:00), and short offset (e.g., +8).

For the full list of supported time zone values, see Time zones.

Return value

Returns a TIMESTAMP_NTZ value accurate to the millisecond.

The return value follows these rules:

  • Trailing zeros in the millisecond part are trimmed. For example, 000 becomes 0, 100 becomes 1, and 120 becomes 12.

  • If time_zone is NULL, the function returns NULL.

Examples

The following examples assume the current system time is 2025-11-05 14:33:15.438 (UTC+8).

Example 1: Default behavior (no time zone specified)

Returns the timestamp in UTC.

StatementResult
SELECT CURRENT_TIMESTAMP_NTZ();2025-11-05 06:33:15.438

Example 2: Specify a time zone

All three formats produce the same result. Use whichever fits your workflow.

StatementResult
SELECT CURRENT_TIMESTAMP_NTZ('Asia/Dhaka');2025-11-05 12:33:15.438
SELECT CURRENT_TIMESTAMP_NTZ('UTC+06:00');2025-11-05 12:33:15.438
SELECT CURRENT_TIMESTAMP_NTZ('+6');2025-11-05 12:33:15.438

Example 3: NULL input

StatementResult
SELECT CURRENT_TIMESTAMP_NTZ(NULL);NULL

Related functions

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