O'Reilly logo

Amazon Redshift: A Columnar Database SQL and Architecture by David Cook, Tom Coffing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12 - Date Functions

"An inch of time cannot be bought with an inch of gold."

- Chinese Proverb

Current_Date

This example uses the Current_Date to return the current date.

SELECT Current_Date as ANSI_Date;

ANSI_Date

------------

2014-10-04

“Not all who wander are lost.”

–J. R. R. Tolkien

The Current_Date will return today's date

TIMEOFDAY()

TIMEOFDAY() returns a VARCHAR data type and specifies the weekday, date, and time.

SELECT TIMEOFDAY() ;

timeofday

------------

Mon Oct 6 22:53:50.333525 2014 UTC

“Always remember that you are unique just like everyone else.”

– Anonymous

The TIMEOFDAY function returns the weekday, date and the time.

SYSDATE Returns a Timestamp With Microseconds

This example uses the SYSDATE functionto return ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required