Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

SYSDATE function

Focus mode
SYSDATE function - Amazon Redshift

SYSDATE returns the current date and time in the current session time zone (UTC by default).

Note

SYSDATE returns the start date and time for the current transaction, not for the start of the current statement.

Syntax

SYSDATE

This function requires no arguments.

Return type

TIMESTAMP

Examples

The following example uses the SYSDATE function to return the full timestamp for the current date.

select sysdate; timestamp ---------------------------- 2008-12-04 16:10:43.976353

The following example uses the SYSDATE function inside the TRUNC function to return the current date without the time.

select trunc(sysdate); trunc ------------ 2008-12-04

The following query returns sales information for dates that fall between the date when the query is issued and whatever date is 120 days earlier.

select salesid, pricepaid, trunc(saletime) as saletime, trunc(sysdate) as now from sales where saletime between trunc(sysdate)-120 and trunc(sysdate) order by saletime asc; salesid | pricepaid | saletime | now ---------+-----------+------------+------------ 91535 | 670.00 | 2008-08-07 | 2008-12-05 91635 | 365.00 | 2008-08-07 | 2008-12-05 91901 | 1002.00 | 2008-08-07 | 2008-12-05 ...

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.