View a markdown version of this page

TIMEOFDAY function - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026. We will start enforcing it in phases. For more information on the details of Python end of life and migration options, see the blog post that was published on June 30, 2025.

TIMEOFDAY function

TIMEOFDAY is a special alias used to return the weekday, date, and time as a string value. It returns the time of day string for the current statement, even when it is within a transaction block.

Syntax

TIMEOFDAY()

Return type

VARCHAR

Examples

The following example returns the current date and time by using the TIMEOFDAY function.

select timeofday(); timeofday ------------ Thu Sep 19 22:53:50.333525 2013 UTC