Date and Time Functions

This section provides reference information for the date and time functions in PlaidCloud Lakehouse.


ADD_MONTHS

Learn how to use the ADD_MONTHS date/time function in PlaidCloud Lakehouse. Adds a specified number of months to a date - see syntax, examples, and output.

ADDDATE

Learn how to use the ADDDATE date/time function in PlaidCloud Lakehouse. Adds a specified time interval to a date. Alias for DATE_ADD.

CONVERT_TZ

Learn how to use the CONVERT_TZ date/time function in PlaidCloud Lakehouse. Converts a datetime from one time zone to another - with syntax and examples.

CURDATE

Learn how to use the CURDATE date/time function in PlaidCloud Lakehouse. Returns the current date - see syntax, examples, and output.

CURRENT_DATE

Learn how to use the CURRENT_DATE date/time function in PlaidCloud Lakehouse. Returns the current date. Alias for CURDATE - with syntax and examples.

CURRENT_TIME

Learn how to use the CURRENT_TIME date/time function in PlaidCloud Lakehouse. Returns the current time - see syntax, examples, and output.

CURRENT_TIMESTAMP

Learn how to use the CURRENT_TIMESTAMP date/time function in PlaidCloud Lakehouse. Returns the current date and time - see syntax, examples, and output.

CURRENT_TIMEZONE

Learn how to use the CURRENT_TIMEZONE date/time function in PlaidCloud Lakehouse. Returns the current session time zone - see syntax, examples, and output.

CURTIME

Learn how to use the CURTIME date/time function in PlaidCloud Lakehouse. Returns the current time. Alias for CURRENT_TIME - with syntax and examples.

DATE

Learn how to use the DATE date/time function in PlaidCloud Lakehouse. Extracts the date part from a datetime expression - see syntax, examples, and output.

DATE_ADD

Learn how to use the DATE_ADD date/time function in PlaidCloud Lakehouse. Adds a specified time interval to a date or datetime - with syntax and examples.

DATE_DIFF

Learn how to use the DATE_DIFF date/time function in PlaidCloud Lakehouse. Returns the difference between two dates in the specified unit.

DATE_FORMAT

Learn how to use the DATE_FORMAT date/time function in PlaidCloud Lakehouse. Formats a date or datetime value according to a format string.

DATE_SLICE

Use the DATE_SLICE date/time function in PlaidCloud Lakehouse. Converts a given time to the beginning or end of a time interval based on the specified period.

DATE_SUB

Learn how to use the DATE_SUB date/time function in PlaidCloud Lakehouse. Subtracts a specified time interval from a date or datetime.

DATE_TRUNC

Learn how to use the DATE_TRUNC date/time function in PlaidCloud Lakehouse. Truncates a date or datetime value to the specified precision.

DATEDIFF

Learn how to use the DATEDIFF date/time function in PlaidCloud Lakehouse. Returns the number of days between two dates - see syntax, examples, and output.

DAY

Learn how to use the DAY date/time function in PlaidCloud Lakehouse. Returns the day of the month from a date - see syntax, examples, and output.

DAYNAME

Learn how to use the DAYNAME date/time function in PlaidCloud Lakehouse. Returns the name of the weekday for a date - see syntax, examples, and output.

DAYOFMONTH

Learn how to use the DAYOFMONTH date/time function in PlaidCloud Lakehouse. Returns the day of the month from a date. Alias for DAY.

DAYOFWEEK

Learn how to use the DAYOFWEEK date/time function in PlaidCloud Lakehouse. Returns the day of the week index for a date (1=Sunday, 7=Saturday).

DAYOFWEEK_ISO

Learn how to use the DAYOFWEEK_ISO date/time function in PlaidCloud Lakehouse. Returns the ISO day of the week index for a date (1=Monday, 7=Sunday).

DAYOFYEAR

Learn how to use the DAYOFYEAR date/time function in PlaidCloud Lakehouse. Returns the day of the year from a date - see syntax, examples, and output.

DAYS_ADD

Learn how to use the DAYS_ADD date/time function in PlaidCloud Lakehouse. Adds a specified number of days to a date - see syntax, examples, and output.

DAYS_DIFF

Learn how to use the DAYS_DIFF date/time function in PlaidCloud Lakehouse. Returns the number of days between two dates - see syntax, examples, and output.

DAYS_SUB

Learn how to use the DAYS_SUB date/time function in PlaidCloud Lakehouse. Subtracts a specified number of days from a date - with syntax and examples.

FROM_DAYS

Learn how to use the FROM_DAYS date/time function in PlaidCloud Lakehouse. Converts a day count to a date - see syntax, examples, and output.

FROM_UNIXTIME

Learn how to use the FROM_UNIXTIME date/time function in PlaidCloud Lakehouse. Converts a Unix timestamp to a datetime string - with syntax and examples.

HOUR

Learn how to use the HOUR date/time function in PlaidCloud Lakehouse. Returns the hour from a datetime - see syntax, examples, and output.

HOURS_ADD

Learn how to use the HOURS_ADD date/time function in PlaidCloud Lakehouse. Adds a specified number of hours to a datetime - with syntax and examples.

HOURS_DIFF

Learn how to use the HOURS_DIFF date/time function in PlaidCloud Lakehouse. Returns the number of hours between two datetimes - with syntax and examples.

HOURS_SUB

Learn how to use the HOURS_SUB date/time function in PlaidCloud Lakehouse. Subtracts a specified number of hours from a datetime - with syntax and examples.

JODATIME_FORMAT

Learn how to use the JODATIME_FORMAT date/time function in PlaidCloud Lakehouse. Formats a date or datetime using Joda-Time format patterns.

LAST_DAY

Learn how to use the LAST_DAY date/time function in PlaidCloud Lakehouse. Returns the last day of the month for a given date - with syntax and examples.

LOCALTIME

Learn how to use the LOCALTIME date/time function in PlaidCloud Lakehouse. Returns the current date and time. Alias for NOW - with syntax and examples.

LOCALTIMESTAMP

Learn how to use the LOCALTIMESTAMP date/time function in PlaidCloud Lakehouse. Returns the current date and time. Alias for NOW - with syntax and examples.

MAKEDATE

Learn how to use the MAKEDATE date/time function in PlaidCloud Lakehouse. Creates a date from a year and day-of-year value - with syntax and examples.

MICROSECONDS_ADD

Learn how to use the MICROSECONDS_ADD date/time function in PlaidCloud Lakehouse. Adds a specified number of microseconds to a datetime.

MICROSECONDS_SUB

Learn how to use the MICROSECONDS_SUB date/time function in PlaidCloud Lakehouse. Subtracts a specified number of microseconds from a datetime.

MILLISECONDS_DIFF

Learn how to use the MILLISECONDS_DIFF date/time function in PlaidCloud Lakehouse. Returns the number of milliseconds between two datetimes.

MINUTE

Learn how to use the MINUTE date/time function in PlaidCloud Lakehouse. Returns the minute from a datetime - see syntax, examples, and output.

MINUTES_ADD

Learn how to use the MINUTES_ADD date/time function in PlaidCloud Lakehouse. Adds a specified number of minutes to a datetime - with syntax and examples.

MINUTES_DIFF

Learn how to use the MINUTES_DIFF date/time function in PlaidCloud Lakehouse. Returns the number of minutes between two datetimes - with syntax and examples.

MINUTES_SUB

Learn how to use the MINUTES_SUB date/time function in PlaidCloud Lakehouse. Subtracts a specified number of minutes from a datetime - with syntax and examples.

MONTH

Learn how to use the MONTH date/time function in PlaidCloud Lakehouse. Returns the month from a date - see syntax, examples, and output.

MONTHNAME

Learn how to use the MONTHNAME date/time function in PlaidCloud Lakehouse. Returns the name of the month for a date - see syntax, examples, and output.

MONTHS_ADD

Learn how to use the MONTHS_ADD date/time function in PlaidCloud Lakehouse. Adds a specified number of months to a date - see syntax, examples, and output.

MONTHS_DIFF

Learn how to use the MONTHS_DIFF date/time function in PlaidCloud Lakehouse. Returns the number of months between two dates - with syntax and examples.

MONTHS_SUB

Learn how to use the MONTHS_SUB date/time function in PlaidCloud Lakehouse. Subtracts a specified number of months from a date - with syntax and examples.

NEXT_DAY

Learn how to use the NEXT_DAY date/time function in PlaidCloud Lakehouse. Returns the date of the next specified weekday after a given date.

NOW

Learn how to use the NOW date/time function in PlaidCloud Lakehouse. Returns the current date and time - see syntax, examples, and output.

PREVIOUS_DAY

Learn how to use the PREVIOUS_DAY date/time function in PlaidCloud Lakehouse. Returns the date of the previous specified weekday before a given date.

QUARTER

Learn how to use the QUARTER date/time function in PlaidCloud Lakehouse. Returns the quarter of the year from a date (1-4) - with syntax and examples.

SEC_TO_TIME

Learn how to use the SEC_TO_TIME date/time function in PlaidCloud Lakehouse. Converts seconds to a time value - see syntax, examples, and output.

SECOND

Learn how to use the SECOND date/time function in PlaidCloud Lakehouse. Returns the second from a datetime - see syntax, examples, and output.

SECONDS_ADD

Learn how to use the SECONDS_ADD date/time function in PlaidCloud Lakehouse. Adds a specified number of seconds to a datetime - with syntax and examples.

SECONDS_DIFF

Learn how to use the SECONDS_DIFF date/time function in PlaidCloud Lakehouse. Returns the number of seconds between two datetimes - with syntax and examples.

SECONDS_SUB

Learn how to use the SECONDS_SUB date/time function in PlaidCloud Lakehouse. Subtracts a specified number of seconds from a datetime - with syntax and examples.

STR_TO_DATE

Learn how to use the STR_TO_DATE date/time function in PlaidCloud Lakehouse. Parses a string into a date using a format string - with syntax and examples.

STR_TO_JODATIME

Learn how to use the STR_TO_JODATIME date/time function in PlaidCloud Lakehouse. Parses a string into a datetime using Joda-Time format patterns.

STR2DATE

Learn how to use the STR2DATE date/time function in PlaidCloud Lakehouse. Parses a string into a date using a format string. Alias for STR_TO_DATE.

SUBDATE

Learn how to use the SUBDATE date/time function in PlaidCloud Lakehouse. Subtracts a time interval from a date. Alias for DATE_SUB - with syntax and examples.

TIME_FORMAT

Learn how to use the TIME_FORMAT date/time function in PlaidCloud Lakehouse. Formats a time value according to a format string - with syntax and examples.

TIME_SLICE

Learn how to use the TIME_SLICE date/time function in PlaidCloud Lakehouse. Converts a given time to the beginning or end of a time interval.

TIME_TO_SEC

Learn how to use the TIME_TO_SEC date/time function in PlaidCloud Lakehouse. Converts a time value to seconds - see syntax, examples, and output.

TIMEDIFF

Learn how to use the TIMEDIFF date/time function in PlaidCloud Lakehouse. Returns the difference between two time values - see syntax, examples, and output.

TIMESTAMP

Learn how to use the TIMESTAMP date/time function in PlaidCloud Lakehouse. Converts a date or string to a datetime - see syntax, examples, and output.

TIMESTAMPADD

Learn how to use the TIMESTAMPADD date/time function in PlaidCloud Lakehouse. Adds a specified time interval to a datetime - with syntax and examples.

TIMESTAMPDIFF

Learn how to use the TIMESTAMPDIFF date/time function in PlaidCloud Lakehouse. Returns the difference between two datetimes in the specified unit.

TO_DATE

Learn how to use the TO_DATE date/time function in PlaidCloud Lakehouse. Converts a datetime to a date - see syntax, examples, and output.

TO_DATETIME

Learn how to use the TO_DATETIME date/time function in PlaidCloud Lakehouse. Converts a value to a datetime - see syntax, examples, and output.

TO_DATETIME_NTZ

Use the TO_DATETIME_NTZ date/time function in PlaidCloud Lakehouse. Converts a value to a DATETIME without time zone (NTZ). The result is not affected by.

TO_DAYS

Learn how to use the TO_DAYS date/time function in PlaidCloud Lakehouse. Converts a date to a day count - see syntax, examples, and output.

TO_ISO8601

Learn how to use the TO_ISO8601 date/time function in PlaidCloud Lakehouse. Converts a date or datetime to an ISO 8601 formatted string.

TO_TERA_DATE

Learn how to use the TO_TERA_DATE date/time function in PlaidCloud Lakehouse. Converts a VARCHAR value to a DATE value according to a Teradata format string.

TO_TERA_TIMESTAMP

Use the TO_TERA_TIMESTAMP date/time function in PlaidCloud Lakehouse. Converts a VARCHAR value to a DATETIME value according to a Teradata format string.

UNIX_TIMESTAMP

Learn how to use the UNIX_TIMESTAMP date/time function in PlaidCloud Lakehouse. Converts a datetime to a Unix timestamp - see syntax, examples, and output.

UTC_TIME

Learn how to use the UTC_TIME date/time function in PlaidCloud Lakehouse. Returns the current UTC time - see syntax, examples, and output.

UTC_TIMESTAMP

Learn how to use the UTC_TIMESTAMP date/time function in PlaidCloud Lakehouse. Returns the current UTC date and time - see syntax, examples, and output.

WEEK

Learn how to use the WEEK date/time function in PlaidCloud Lakehouse. Returns the week number of the year for a date - see syntax, examples, and output.

WEEK_ISO

Learn how to use the WEEK_ISO date/time function in PlaidCloud Lakehouse. Returns the ISO week number of the year for a date - with syntax and examples.

WEEKDAY

Learn how to use the WEEKDAY date/time function in PlaidCloud Lakehouse. Returns the weekday index for a date (0=Monday, 6=Sunday) - with syntax and examples.

WEEKOFYEAR

Learn how to use the WEEKOFYEAR date/time function in PlaidCloud Lakehouse. Returns the week of the year for a date. Alias for WEEK.

WEEKS_ADD

Learn how to use the WEEKS_ADD date/time function in PlaidCloud Lakehouse. Adds a specified number of weeks to a date - see syntax, examples, and output.

WEEKS_DIFF

Learn how to use the WEEKS_DIFF date/time function in PlaidCloud Lakehouse. Returns the number of weeks between two dates - with syntax and examples.

WEEKS_SUB

Learn how to use the WEEKS_SUB date/time function in PlaidCloud Lakehouse. Subtracts a specified number of weeks from a date - with syntax and examples.

YEAR

Learn how to use the YEAR date/time function in PlaidCloud Lakehouse. Returns the year from a date - see syntax, examples, and output.

YEARS_ADD

Learn how to use the YEARS_ADD date/time function in PlaidCloud Lakehouse. Adds a specified number of years to a date - see syntax, examples, and output.

YEARS_DIFF

Learn how to use the YEARS_DIFF date/time function in PlaidCloud Lakehouse. Returns the number of years between two dates - with syntax and examples.

YEARS_SUB

Learn how to use the YEARS_SUB date/time function in PlaidCloud Lakehouse. Subtracts a specified number of years from a date - with syntax and examples.

YEARWEEK

Learn how to use the YEARWEEK date/time function in PlaidCloud Lakehouse. Returns the year and week number for a date as an integer - with syntax and examples.