All functions > DATE AND TIME

All functions in the DATE AND TIME category.

Backend availability

DD Available DD Partially available DD Not available DD DuckDB · PG Postgres · CH ClickHouse · TR Trino · BQ BigQuery · SF Snowflake · DB Databricks · SV Serving

Date/timestamp arithmetic

FunctionDescriptionBackends
ADD()Returns the timestamp after adding an interval to a date or timestamp.DDPGCHTRBQSFDBSV
DATE_ADD()Returns the date/timestamp after adding a given number of a given units to the given date or...DDPGCHTRBQSFDBSV
SUBTRACT()Subtracts an interval from a timestamp or date, or returns the interval between two timestamps or...DDPGCHTRBQSFDBSV
DATE_SUBTRACT()Returns the number of complete elapsed units in timestamp1 − timestamp2. Chaining-friendly: the...DDPGCHTRBQSFDBSV
DATE_DIFF()Returns the number of calendar boundary crossings in timestamp1 − timestamp2. Same argument order...DDPGCHTRBQSFDBSV

Calendar queries

FunctionDescriptionBackends
FIRST_DAY_OF()Returns the first calendar day of the period containing the given date or timestamp: a DATE for a...DDPGCHTRBQSFDBSV
LAST_DAY_OF()Returns the last calendar day of the period containing the given date or timestamp: a DATE for a...DDPGCHTRBQSFDBSV
DAYS_IN()Returns the number of calendar days in the MONTH, QUARTER, HALF (half-year), or YEAR that contains...DDPGCHTRBQSFDBSV

Sequence generation

FunctionDescriptionBackends
SEQUENCE()Generates an inclusive array of dates or timestamps separated by an interval.DDPGCHTRBQSFDBSV
DATE_SEQUENCE()Returns an array of timestamps: `count` values beginning at `start`, each separated by `interval`.DDPGCHTRBQSFDBSV

Extraction

FunctionDescriptionBackends
DATE_PART()Returns the part of the given timestamp in the given unit.DDPGCHTRBQSFDBSV
DAY()Returns the day component of a date or timestamp.DDPGCHTRBQSFDBSV
HOUR()Returns the hour component of a date or timestamp.DDPGCHTRBQSFDBSV
MINUTE()Returns the minute component of a date or timestamp.DDPGCHTRBQSFDBSV
MONTH()Returns the month component of a date or timestamp.DDPGCHTRBQSFDBSV
QUARTER()Returns the quarter component of a date or timestamp.DDPGCHTRBQSFDBSV
SECOND()Returns the second component of a date or timestamp.DDPGCHTRBQSFDBSV
WEEK()Returns the week component of a date or timestamp.DDPGCHTRBQSFDBSV
YEAR()Returns the year component of a date or timestamp.DDPGCHTRBQSFDBSV

Truncation and formatting

FunctionDescriptionBackends
DATE_TRUNC()Returns the given date or timestamp truncated to the given unit.DDPGCHTRBQSFDBSV
DATE_FORMAT()Returns a string from the given date or timestamp and format.DDPGCHTRBQSFDBSV
TO_ISO8601()Returns an ISO 8601 string from the given timestamp or interval.DDPGCHTRBQSFDBSV

Parsing and construction

FunctionDescriptionBackends
DATE_PARSE()Returns a timestamp from the given string and format.DDPGCHTRBQSFDBSV
FROM_ISO8601_TIMESTAMP()Returns a timestamp from the given ISO 8601 string.DDPGCHTRBQSFDBSV
MAKE_DATE()Builds a DATE from its year, month and day, given as three arguments or as a ROW.DDPGCHTRBQSFDBSV
MAKE_TIMESTAMP()Builds a TIMESTAMP from its calendar and clock components, given as six arguments or as a ROW.DDPGCHTRBQSFDBSV

Unix time conversion

FunctionDescriptionBackends
FROM_UNIXTIME()Returns a timestamp from the given unix timestamp (BIGINT representation of the number of seconds...DDPGCHTRBQSFDBSV
TO_UNIXTIME()Returns a unix timestamp (DECIMAL seconds since 1970-01-01 00:00:00 UTC) from the given date or...DDPGCHTRBQSFDBSV

Timezone conversion

FunctionDescriptionBackends
LOCAL_TO_UTC()Converts a local clock time (TIMESTAMPTZ) in the given zone to a UTC TIMESTAMP.DDPGCHTRBQSFDBSV
UTC_TO_LOCAL()Converts a UTC TIMESTAMP to the local clock time in the given timezone (TIMESTAMPTZ).DDPGCHTRBQSFDBSV

Interval operations

FunctionDescriptionBackends
MAKE_INTERVAL()Builds an INTERVAL from a ROW of duration components.DDPGCHTRBQSFDBSV
FROM_ISO8601_INTERVAL()Returns an interval from the given ISO 8601 duration string.DDPGCHTRBQSFDBSV
INTERVAL_PARSE()Returns an interval from the given duration string.DDPGCHTRBQSFDBSV
INTERVAL_TO_MS()Returns the truncated number of milliseconds in the given interval.DDPGCHTRBQSFDBSV
UNSAFE_NATIVE()Returns the value an INTERVAL is stored as on the backend, instead of its canonical text.DDPGCHTRBQSFDBSV
TO_ISO8601()Returns an ISO 8601 duration string from the given interval.DDPGCHTRBQSFDBSV
MULTIPLY()Scales an interval by an integer factor.DDPGCHTRBQSFDBSV

Summary
Functions in this category: 37

This documentation is automatically generated from the FeatureMesh registry.