SUM_TIMESTAMP_TZ_UDF (TIMESTAMP_TZ, TIMESTAMP_TZ)

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