TIME-to-TIME Conversion Example 6 - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530

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

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

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

This result of the SELECT statement 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(TIME '08:30:00+04:00' AS TIME(0) 
   WITH TIME ZONE AT -8);