

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

# TIMESTAMP\$1CMP\$1TIMESTAMPTZ function
<a name="r_TIMESTAMP_CMP_TIMESTAMPTZ"></a>

TIMESTAMP\$1CMP\$1TIMESTAMPTZ compares the value of a timestamp expression with a timestamp with time zone expression. If the timestamp and timestamp with time zone values are identical, the function returns `0`. If the timestamp is greater chronologically, the function returns `1`. If the timestamp with time zone is greater, the function returns `–1`.

## Syntax
<a name="r_TIMESTAMP_CMP_TIMESTAMPTZ-syntax"></a>

```
TIMESTAMP_CMP_TIMESTAMPTZ(timestamp, timestamptz)
```

## Arguments
<a name="r_TIMESTAMP_CMP_TIMESTAMPTZ-arguments"></a>

 *timestamp*   
A column of data type `TIMESTAMP` or an expression that implicitly evaluates to a `TIMESTAMP` type.

 *timestamptz*   
A column of data type `TIMESTAMPTZ` or an expression that implicitly evaluates to a `TIMESTAMPTZ` type.

## Return type
<a name="r_TIMESTAMP_CMP_TIMESTAMPTZ-return-type"></a>

INTEGER

## Examples
<a name="r_TIMESTAMP_CMP_TIMESTAMPTZ-examples"></a>

The following example compares timestamps to timestamps with time zones and shows the results of the comparison.

```
SELECT TIMESTAMP_CMP_TIMESTAMPTZ('2008-01-24 06:43:29', '2008-01-24 06:43:29+00'), TIMESTAMP_CMP_TIMESTAMPTZ('2008-01-24 06:43:29', '2008-02-18 02:36:48+00'), TIMESTAMP_CMP_TIMESTAMPTZ('2008-02-18 02:36:48', '2008-01-24 06:43:29+00');

timestamp_cmp_timestamptz  | timestamp_cmp_timestamptz | timestamp_cmp_timestamptz 
---------------------------+---------------------------+--------------------------
             0             |            -1             |             1
```