Convert TimeStamp to Date in Teradata

access_time 5 months ago visibility1080 comment 0

Current timestamp

Function CURRENT_TIMESTAMP can be used to retrieve the current timestamp:


Sample output:

20/09/2020 20:55:35.390000-04:00

Convert TimeStamp to Date

Function CAST can be used to convert TimeStamp to DATE.


Sample output:


Convert Date to TimeStamp


Sample output:

20/09/2020 00:00:00.000000

Convert Varchar to TimeStamp

SELECT CAST('2017-10-15 23:59:59.999999 +10:00' AS TIMESTAMP(6) WITH TIME ZONE FORMAT 'YYYY-MM-DDBHH:MI:SS.S(6)BZ');

Sample output:

15/10/2017 23:59:59.999999+10:00

More examples

Refer to Teradata Tutorial – DateTime Related Functions and Examples for more example about Teradata DATE and TIME related function. 

copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Follow Kontext

Get our latest updates on LinkedIn or Twitter.

Want to publish your article on Kontext?

Learn more

More from Kontext

visibility 201
thumb_up 0
access_time 5 months ago

Teradata FastLoad can be used to load CSV/TSV or other delimited files into database. Refer to article  Teradata FastLoad - Load CSV File  for more details about how to load CSV into Teradata. This article shows how to skip header line or multiple lines in the input file.  Create a ...

visibility 8394
thumb_up 0
access_time 6 years ago

In this post, I will demonstrate how to connect to Teradata database via .NET Data Provider for Teradata using C#. Install the .NET Data Provider for Teradata from the following link: Teradata Tools and Utilities Windows Installation Package Name it as’' ‘ConsoleApps.Teradata’. Add ...

visibility 467
thumb_up 0
access_time 10 months ago

In SQL Server, we can use TRUNCATE statement to clear all the records in a table and it usually performs better compared with DELETE statements as no transaction log for each individual row deletion. The syntax looks like the following: TRUNCATE TABLE { database_name.schema_name.table_name | ...