

 Amazon Redshift will no longer support the creation of new Python UDFs starting Patch 198. Existing Python UDFs will continue to function until June 30, 2026. For more information, see the [ blog post ](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

# Date and time functions
<a name="Date_functions_header"></a>

In this section, you can find information about the date and time scalar functions that Amazon Redshift supports.

**Topics**
+ [Summary of date and time functions](#date-functions-summary)
+ [Date and time functions in transactions](#date-functions-transactions)
+ [Deprecated leader node-only functions](#date-functions-deprecated)
+ [\$1 (Concatenation) operator](r_DATE-CONCATENATE_function.md)
+ [ADD\$1MONTHS function](r_ADD_MONTHS.md)
+ [AT TIME ZONE function](r_AT_TIME_ZONE.md)
+ [CONVERT\$1TIMEZONE function](CONVERT_TIMEZONE.md)
+ [CURRENT\$1DATE function](r_CURRENT_DATE_function.md)
+ [DATE\$1CMP function](r_DATE_CMP.md)
+ [DATE\$1CMP\$1TIMESTAMP function](r_DATE_CMP_TIMESTAMP.md)
+ [DATE\$1CMP\$1TIMESTAMPTZ function](r_DATE_CMP_TIMESTAMPTZ.md)
+ [DATEADD function](r_DATEADD_function.md)
+ [DATEDIFF function](r_DATEDIFF_function.md)
+ [DATE\$1PART function](r_DATE_PART_function.md)
+ [DATE\$1PART\$1YEAR function](r_DATE_PART_YEAR.md)
+ [DATE\$1TRUNC function](r_DATE_TRUNC.md)
+ [EXTRACT function](r_EXTRACT_function.md)
+ [GETDATE function](r_GETDATE.md)
+ [INTERVAL\$1CMP function](r_INTERVAL_CMP.md)
+ [LAST\$1DAY function](r_LAST_DAY.md)
+ [MONTHS\$1BETWEEN function](r_MONTHS_BETWEEN_function.md)
+ [NEXT\$1DAY function](r_NEXT_DAY.md)
+ [SYSDATE function](r_SYSDATE.md)
+ [TIMEOFDAY function](r_TIMEOFDAY_function.md)
+ [TIMESTAMP\$1CMP function](r_TIMESTAMP_CMP.md)
+ [TIMESTAMP\$1CMP\$1DATE function](r_TIMESTAMP_CMP_DATE.md)
+ [TIMESTAMP\$1CMP\$1TIMESTAMPTZ function](r_TIMESTAMP_CMP_TIMESTAMPTZ.md)
+ [TIMESTAMPTZ\$1CMP function](r_TIMESTAMPTZ_CMP.md)
+ [TIMESTAMPTZ\$1CMP\$1DATE function](r_TIMESTAMPTZ_CMP_DATE.md)
+ [TIMESTAMPTZ\$1CMP\$1TIMESTAMP function](r_TIMESTAMPTZ_CMP_TIMESTAMP.md)
+ [TIMEZONE function](r_TIMEZONE.md)
+ [TO\$1TIMESTAMP function](r_TO_TIMESTAMP.md)
+ [TRUNC function](r_TRUNC_date.md)
+ [Date parts for date or timestamp functions](r_Dateparts_for_datetime_functions.md)

## Summary of date and time functions
<a name="date-functions-summary"></a>

[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/redshift/latest/dg/Date_functions_header.html)

**Note**  
Leap seconds are not considered in elapsed-time calculations.

## Date and time functions in transactions
<a name="date-functions-transactions"></a>

When you run the following functions within a transaction block (BEGIN … END), the function returns the start date or time of the current transaction, not the start of the current statement.
+ SYSDATE
+ TIMESTAMP
+ CURRENT\$1DATE

The following functions always return the start date or time of the current statement, even when they are within a transaction block.
+ GETDATE
+ TIMEOFDAY

## Deprecated leader node-only functions
<a name="date-functions-deprecated"></a>

The following date functions are deprecated because they run only on the leader node. For more information, see [Leader node–only functions](c_SQL_functions_leader_node_only.md).
+ AGE. Use [DATEDIFF function](r_DATEDIFF_function.md) instead.
+ CURRENT\$1TIME. Use [GETDATE function](r_GETDATE.md) or [SYSDATE](r_SYSDATE.md) instead. 
+ CURRENT\$1TIMESTAMP. Use [GETDATE function](r_GETDATE.md) or [SYSDATE](r_SYSDATE.md) instead.
+ LOCALTIME. Use [GETDATE function](r_GETDATE.md) or [SYSDATE](r_SYSDATE.md) instead.
+ LOCALTIMESTAMP. Use [GETDATE function](r_GETDATE.md) or [SYSDATE](r_SYSDATE.md) instead.
+ ISFINITE 
+ NOW. Use [GETDATE function](r_GETDATE.md) or [SYSDATE](r_SYSDATE.md) instead. If you use the NOW function within a materialized view, it sets to the timestamp of the creation of the materialized view, instead of the current timestamp. 