16.20 - Example - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ Data Types and Literals

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1143-162K

In this example, the time zone displacement specified in the literal, INTERVAL '04:00' HOUR TO MINUTE, is used to determine the UTC value '2008-06-01 04:30:00' for the TIMESTAMP literal.

The result of the CAST is the time formed from the time portion of the source expression value '2008-06-01 04:30:00' at UTC, and the time zone displacement of the source expression, INTERVAL '04:00' HOUR TO MINUTE.

The result value of the CAST '04:30:00' at UTC is adjusted to its time zone displacement, INTERVAL '04:00' HOUR TO MINUTE, and the result of the SELECT statements is: TIME '08:30:00+04:00'.

The result of the SELECT statements is equal to TIME '04:30:00+00:00'. The current session time zone displacement, INTERVAL -'08:00' HOUR TO MINUTE, has no effect.

SET TIME ZONE INTERVAL -'08:00' HOUR TO MINUTE;
SELECT CAST(TIMESTAMP '2008-06-01 08:30:00+04:00' 
   AS TIME(0) WITH TIME ZONE);
SELECT CAST(TIMESTAMP '2008-06-01 08:30:00+04:00'
   AS TIME(0) WITH TIME ZONE AT SOURCE TIME ZONE);