All functions > DATE AND TIME

All functions in the DATE AND TIME category.

Date/timestamp arithmetic

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

Calendar queries

FunctionDuckDBTrinoServingDescription
FIRST_DAY_OF()✓✓✓Returns the first calendar day of the period containing the given date or timestamp, as midnight on...
LAST_DAY_OF()✓✓✓Returns the last calendar day of the period containing the given date or timestamp, as midnight on...
DAYS_IN()✓✓✓Returns the number of calendar days in the MONTH, QUARTER, HALF (half-year), or YEAR that contains...

Sequence generation

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

Extraction

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

Truncation and formatting

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

Parsing and construction

FunctionDuckDBTrinoServingDescription
DATE_PARSE()✓✓✓Returns a timestamp from the given string and format.
FROM_ISO8601_TIMESTAMP()✓✓✓Returns a timestamp from the given ISO 8601 string.
MAKE_DATE()✓✓✓Builds a DATE from a ROW of calendar components.
MAKE_TIMESTAMP()✓✓✓Builds a TIMESTAMP from a ROW of calendar and clock components.

Unix time conversion

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

Timezone conversion

FunctionDuckDBTrinoServingDescription
LOCAL_TO_UTC()✓✓✓Treats a naive TIMESTAMP as local wall time in the given zone and returns the same instant as a...
UTC_TO_LOCAL()✓✓✓Interprets a naive UTC TIMESTAMP as an instant and returns it in the given timezone (TIMESTAMPTZ).

Interval operations

FunctionDuckDBTrinoServingDescription
MAKE_INTERVAL()✓✓✓Builds an INTERVAL from a ROW of duration components.
FROM_ISO8601_INTERVAL()✓✗✗Returns an interval from the given ISO 8601 duration string.
INTERVAL_PARSE()✓✓✓Returns an interval from the given duration string.
INTERVAL_TO_MS()✓✓✓Returns the truncated number of milliseconds in the given interval.
TO_ISO8601()✓✓✓Returns an ISO 8601 duration string from the given interval.
MULTIPLY()✓✓✓Scales an interval by an integer factor.

Summary
Functions in this category: 36

This documentation is automatically generated from the FeatureMesh registry.