TIME-to-TIME Conversion Example 1 - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

In this example, the current session time zone displacement, INTERVAL '01:00' HOUR TO MINUTE, is used to determine the UTC value, '07:30:00' of the TIME literal.

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

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

The result of the SELECT statements is equal to TIME '07:30:00+00:00' because values are compared based on their UTC values.

SET TIME ZONE INTERVAL '01:00' HOUR TO MINUTE;
   
SELECT CAST(TIME '08:30:00' AS TIME(0) WITH TIME ZONE);
SELECT CAST(TIME '08:30:00' AS TIME(0) WITH TIME ZONE AT LOCAL);