CONVERT_TIMEZONE

functionsupportedCore SQL functions

docs.snowflake.com ↗

Date & time functions

Converts a timestamp to another time zone.

Syntax

CONVERT_TIMEZONE( <source_tz> , <target_tz> , <source_timestamp_ntz> )

CONVERT_TIMEZONE( <target_tz> , <source_timestamp> )

Parameters

NameRequiredDescription
source_tzrequiredString specifying the time zone for the input timestamp. Required for timestamps with no time zone (that is, TIMESTAMP_NTZ).
target_tzrequiredString specifying the time zone to which the input timestamp is converted.
source_timestamp_ntzrequiredFor the 3-argument version, string specifying the timestamp to convert (must be TIMESTAMP_NTZ).
source_timestamprequiredFor the 2-argument version, the timestamp to convert. Can be any timestamp variant (TIMESTAMP_LTZ, TIMESTAMP_NTZ, or TIMESTAMP_TZ) or a DATE value. For how the source time zone is determined for each of these types, see the usage notes below.

Returns

Returns a value of type TIMESTAMP_NTZ, TIMESTAMP_TZ, or NULL: - For the 3-argument version, returns a value of type TIMESTAMP_NTZ. - For the 2-argument version, returns a value of type TIMESTAMP_TZ. - If any argument is NULL, returns NULL.

Usage notes

Referenced by