TIME-to-TIME Conversion Usage Notes - 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

If you specify an AT clause for a TIME[(n)] without time zone target data type, an error is returned.

If you specify an AT clause for a TIME[(n)] WITH TIME ZONE target data type, the following table shows the result of the CAST function or Teradata conversion based on the options specified. If the target precision is higher than the source precision, trailing zeros are added in the result to adjust the precision. If the target precision is lower than the source precision, an error is returned.

Option time_expression Data Type Action
AT LOCAL With or without TIME ZONE  
AT SOURCE

(where SOURCE is keyword and not column reference)

WITH TIME ZONE Result is formed from source time_expression (in UTC) and time zone displacement based on current session time zone.

Data type of time_expression without time zone is same as not specifying AT clause.

Without TIME ZONE Result is formed from time portion of source time_expression (in UTC) and time zone displacement associated with time_expression.

Same as not specifying AT clause.

AT SOURCE TIME ZONE WITH TIME ZONE Result is formed from time portion of source time_expression (in UTC) and time zone displacement associated with time_expression.

Same as not specifying AT clause.

Without TIME ZONE Returns error.
AT [ TIME ZONE ] expression With or without TIME ZONE Result is formed from time portion of source time_expression (in UTC) and time zone displacement defined by expression.
With or without TIME ZONE Result is formed from time portion of source time_expression (in UTC) and time zone displacement based on time_zone_string. Time zone displacement is based on time_zone_string, CURRENT_TIMESTAMP AT '00:00', and TIME value of time_zone_string at UTC.