Example: Converting the DATE Value to a TIMESTAMP Value Based On a Time Zone String - Advanced SQL Engine - Teradata Database

SQL Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-27
dita:mapPath
tpf1598412463935.ditamap
dita:ditavalPath
tpf1598412463935.ditaval
dita:id
B035-1143
lifecycle
previous
Product Category
Teradata Vantageā„¢

In this example, the current timestamp is:

            Current TimeStamp(6)
--------------------------------
2010-03-09 19:23:27.620000+00:00

The following statement converts the DATE value '2010-03-09' to a TIMESTAMP value, where the time zone displacement is based on the time zone string, 'America Pacific'.

SELECT CAST(DATE '2010-03-09' AS TIMESTAMP(0) AT 'America Pacific');

The result of the query is:

         2010-03-09
-------------------
2010-03-09 08:00:00