SUM_TIMESTAMP_TZ_UDF (TIMESTAMP_TZ, TIMESTAMP_TZ)

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Definition

This user-defined function (UDF) converts both inputs to the system or session timezone and sums the dates taking 1900-01-01 00:00:00.000 as the zero value. If any value does not include the timezone, the current session timezone is used.

SUM_TIMESTAMP_TZ_UDF(FIRST_DATE TIMESTAMP_TZ, SECOND_DATE TIMESTAMP_TZ)

Parameters

FIRST_DATE TIMESTAMP_TZ

The first date to sum to.

SECOND_DATE TIMESTAMP_TZ

The second date to sum to.

Returns

Returns the sum between the two input dates.

Usage example

Input:

SELECT SUM_TIMESTAMP_TZ_UDF('1900-01-01 00:00:00.000 +0100', '1900-01-01 00:00:00.003 -0100')

Output:

1900-01-01 00:00:00.003 +0000

Last updated