Date & Time Functions

This section provides reference information for the datetime-related functions in PlaidCloud Lakehouse.

Conversion Functions

Date Arithmetic Functions

Date Information Functions

Others


ADD TIME INTERVAL

Add time interval function

CURRENT_TIMESTAMP

Learn how to use CURRENT_TIMESTAMP in PlaidCloud Lakehouse. Alias for the NOW datetime function. Includes detailed syntax, examples, and usage reference.

DATE

Learn how to use DATE in PlaidCloud Lakehouse. Alias for the TO_DATE datetime function. Includes detailed syntax, examples, and usage reference.

DATE DIFF

Learn how to use the DATE DIFF datetime function in PlaidCloud Lakehouse. PlaidCloud Lakehouse does not provide a date_diff function yet, but it supports...

DATE_ADD

Learn how to use the DATE_ADD datetime function in PlaidCloud Lakehouse. Add the time interval or date interval to the provided date or date with time...

DATE_FORMAT

Learn how to use DATE_FORMAT in PlaidCloud Lakehouse. Alias for the TO_STRING datetime function. Includes detailed syntax, examples, and usage reference.

DATE_PART

Learn how to use the DATE_PART datetime function in PlaidCloud Lakehouse. Retrieves the designated portion of a date, time, or timestamp. Includes syntax...

DATE_SUB

Learn how to use the DATE_SUB datetime function in PlaidCloud Lakehouse. Subtract the time interval or date interval from the provided date or date with...

DATE_TRUNC

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

DAY

Learn how to use DAY in PlaidCloud Lakehouse. Alias for the TO_DAY_OF_MONTH datetime function. Includes detailed syntax, examples, and usage reference.

EXTRACT

Learn how to use the EXTRACT datetime function in PlaidCloud Lakehouse. Retrieves the designated portion of a date, time, or timestamp. Includes syntax and...

LAST_DAY

Learn how to use the LAST_DAY datetime function in PlaidCloud Lakehouse. Returns the last day of the specified interval (week, month, quarter, or year)...

MONTH

Learn how to use MONTH in PlaidCloud Lakehouse. Alias for the TO_MONTH datetime function. Includes detailed syntax, examples, and usage reference.

MONTHS_BETWEEN

Learn how to use the MONTHS_BETWEEN datetime function in PlaidCloud Lakehouse. Returns the number of months between date1 and date2. With syntax and examples.

NEXT_DAY

Learn how to use the NEXT_DAY datetime function in PlaidCloud Lakehouse. Returns the date of the upcoming specified day of the week after the given date or...

NOW

Learn how to use the NOW datetime function in PlaidCloud Lakehouse. Returns the current date and time. Includes detailed syntax, examples, and usage reference.

PREVIOUS_DAY

Learn how to use the PREVIOUS_DAY datetime function in PlaidCloud Lakehouse. Returns the date of the most recent specified day of the week before the given...

QUARTER

Learn how to use QUARTER in PlaidCloud Lakehouse. Alias for the TO_QUARTER datetime function. Includes detailed syntax, examples, and usage reference.

STR_TO_DATE

Learn how to use STR_TO_DATE in PlaidCloud Lakehouse. Alias for the TO_DATE datetime function. Includes detailed syntax, examples, and usage reference.

STR_TO_TIMESTAMP

Learn how to use STR_TO_TIMESTAMP in PlaidCloud Lakehouse. Alias for the TO_TIMESTAMP datetime function. Reference with syntax and examples.

SUBTRACT TIME INTERVAL

Subtract time interval function

TIME_SLOT

Learn how to use the TIME_SLOT datetime function in PlaidCloud Lakehouse. Rounds the time to the half-hour. Full syntax and usage reference.

TIMESTAMP_DIFF

Learn how to use the TIMESTAMP_DIFF datetime function in PlaidCloud Lakehouse. Calculates the difference between two timestamps and returns the result as an...

TIMEZONE

Learn how to use the TIMEZONE datetime function in PlaidCloud Lakehouse. Returns the timezone for the current connection. Includes syntax and examples.

TO_DATE

Learn how to use the TO_DATE datetime function in PlaidCloud Lakehouse. Converts an expression to a date, including:. Includes syntax and examples.

TO_DATETIME

Learn how to use TO_DATETIME in PlaidCloud Lakehouse. Alias for the TO_TIMESTAMP datetime function. Includes detailed syntax, examples, and usage reference.

TO_DAY_OF_MONTH

Learn how to use the TO_DAY_OF_MONTH datetime function in PlaidCloud Lakehouse. Convert a date or date with time (timestamp/datetime) to a UInt8 number...

TO_DAY_OF_WEEK

Learn how to use the TO_DAY_OF_WEEK datetime function in PlaidCloud Lakehouse. Converts a date or date with time (timestamp/datetime) to a UInt8 number...

TO_DAY_OF_YEAR

Learn how to use the TO_DAY_OF_YEAR datetime function in PlaidCloud Lakehouse. Convert a date or date with time (timestamp/datetime) to a UInt16 number...

TO_HOUR

Learn how to use the TO_HOUR datetime function in PlaidCloud Lakehouse. Converts a date with time (timestamp/datetime) to a UInt8 number containing the...

TO_MINUTE

Learn how to use the TO_MINUTE datetime function in PlaidCloud Lakehouse. Converts a date with time (timestamp/datetime) to a UInt8 number containing the...

TO_MONDAY

Learn how to use the TO_MONDAY datetime function in PlaidCloud Lakehouse. Round down a date or date with time (timestamp/datetime) to the nearest Monday.

TO_MONTH

Learn how to use the TO_MONTH datetime function in PlaidCloud Lakehouse. Convert a date or date with time (timestamp/datetime) to a UInt8 number containing...

TO_QUARTER

Learn how to use the TO_QUARTER datetime function in PlaidCloud Lakehouse. Retrieves the quarter (1, 2, 3, or 4) from a given date or timestamp.

TO_SECOND

Learn how to use the TO_SECOND datetime function in PlaidCloud Lakehouse. Converts a date with time (timestamp/datetime) to a UInt8 number containing the...

TO_START_OF_DAY

Learn how to use the TO_START_OF_DAY datetime function in PlaidCloud Lakehouse. Rounds down a date with time (timestamp/datetime) to the start of the day.

TO_START_OF_FIFTEEN_MINUTES

Learn how to use the TO_START_OF_FIFTEEN_MINUTES datetime function in PlaidCloud Lakehouse. Rounds down the date with time (timestamp/datetime) to the start...

TO_START_OF_FIVE_MINUTES

Learn how to use the TO_START_OF_FIVE_MINUTES datetime function in PlaidCloud Lakehouse. Rounds down a date with time (timestamp/datetime) to the start of...

TO_START_OF_HOUR

Learn how to use the TO_START_OF_HOUR datetime function in PlaidCloud Lakehouse. Rounds down a date with time (timestamp/datetime) to the start of the hour.

TO_START_OF_ISO_YEAR

Learn how to use the TO_START_OF_ISO_YEAR datetime function in PlaidCloud Lakehouse. Returns the first day of the ISO year for a date or a date with time...

TO_START_OF_MINUTE

Learn how to use the TO_START_OF_MINUTE datetime function in PlaidCloud Lakehouse. Rounds down a date with time (timestamp/datetime) to the start of the minute.

TO_START_OF_MONTH

Learn how to use the TO_START_OF_MONTH datetime function in PlaidCloud Lakehouse. Rounds down a date or date with time (timestamp/datetime) to the first day...

TO_START_OF_QUARTER

Learn how to use the TO_START_OF_QUARTER datetime function in PlaidCloud Lakehouse. Rounds down a date or date with time (timestamp/datetime) to the first...

TO_START_OF_SECOND

Learn how to use the TO_START_OF_SECOND datetime function in PlaidCloud Lakehouse. Rounds down a date with time (timestamp/datetime) to the start of the second.

TO_START_OF_TEN_MINUTES

Learn how to use the TO_START_OF_TEN_MINUTES datetime function in PlaidCloud Lakehouse. Rounds down a date with time (timestamp/datetime) to the start of...

TO_START_OF_WEEK

Learn how to use the TO_START_OF_WEEK datetime function in PlaidCloud Lakehouse. Returns the first day of the week for a date or a date with time...

TO_START_OF_YEAR

Learn how to use the TO_START_OF_YEAR datetime function in PlaidCloud Lakehouse. Returns the first day of the year for a date or a date with time...

TO_TIMESTAMP

Learn how to use the TO_TIMESTAMP datetime function in PlaidCloud Lakehouse. TO_TIMESTAMP converts an expression to a date with time (timestamp/datetime).

TO_UNIX_TIMESTAMP

Learn how to use the TO_UNIX_TIMESTAMP datetime function in PlaidCloud Lakehouse. Converts a timestamp in a date/time format to a Unix timestamp format.

TO_WEEK_OF_YEAR

Learn how to use the TO_WEEK_OF_YEAR datetime function in PlaidCloud Lakehouse. Calculates the week number within a year for a given date. Includes syntax...

TO_YEAR

Learn how to use the TO_YEAR datetime function in PlaidCloud Lakehouse. Converts a date or date with time (timestamp/datetime) to a UInt16 number containing...

TO_YYYYMM

Learn how to use the TO_YYYYMM datetime function in PlaidCloud Lakehouse. Converts a date or date with time (timestamp/datetime) to a UInt32 number...

TO_YYYYMMDD

Learn how to use the TO_YYYYMMDD datetime function in PlaidCloud Lakehouse. Converts a date or date with time (timestamp/datetime) to a UInt32 number...

TO_YYYYMMDDHH

Learn how to use the TO_YYYYMMDDHH datetime function in PlaidCloud Lakehouse. Formats a given date or timestamp into a string representation in the format...

TO_YYYYMMDDHHMMSS

Learn how to use the TO_YYYYMMDDHHMMSS datetime function in PlaidCloud Lakehouse. Convert a date or date with time (timestamp/datetime) to a UInt64 number...

TODAY

Learn how to use the TODAY datetime function in PlaidCloud Lakehouse. Returns current date. Includes detailed syntax, examples, and usage reference.

TOMORROW

Learn how to use the TOMORROW datetime function in PlaidCloud Lakehouse. Returns tomorrow date, same as today() + 1. Includes syntax and examples.

TRY_TO_DATETIME

Learn how to use TRY_TO_DATETIME in PlaidCloud Lakehouse. Alias for the TRY_TO_TIMESTAMP datetime function. Full syntax and usage reference.

TRY_TO_TIMESTAMP

Learn how to use the TRY_TO_TIMESTAMP datetime function in PlaidCloud Lakehouse. A variant of TO_TIMESTAMP in PlaidCloud Lakehouse that, while performing...

WEEK

Learn how to use WEEK in PlaidCloud Lakehouse. Alias for the TO_WEEK_OF_YEAR datetime function. Includes detailed syntax, examples, and usage reference.

WEEKOFYEAR

Learn how to use WEEKOFYEAR in PlaidCloud Lakehouse. Alias for the TO_WEEK_OF_YEAR datetime function. Includes detailed syntax, examples, and usage reference.

YEAR

Learn how to use YEAR in PlaidCloud Lakehouse. Alias for the TO_YEAR datetime function. Includes detailed syntax, examples, and usage reference.

YESTERDAY

Learn how to use the YESTERDAY datetime function in PlaidCloud Lakehouse. Returns yesterday date, same as today() - 1. Includes syntax and examples.