Loading

ES|QL date-time functions

ES|QL supports these date-time functions:

  • DATE_DIFF

    Returns the difference between two timestamps in the specified unit.

  • DATE_EXTRACT

    Extracts parts of a date, like year, month, day, hour.

  • DATE_FORMAT

    Returns a string representation of a date, in the provided format.

  • DATE_PARSE

    Parses a string into a date using the specified format.

  • DATE_TRUNC

    Rounds down a date to the closest interval.

  • DAY_NAME

    Returns the name of the weekday for a date.

  • MONTH_NAME

    Returns the month name for a date.

  • NOW

    Returns current date and time.

  • RANGE_CONTAINS

    Returns true if a date range contains a given date or sub-range.

  • RANGE_INTERSECTS

    Returns true if two date ranges or dates overlap.

  • RANGE_MAX

    Returns the end value of a date range.

  • RANGE_MIN

    Returns the start value of a date range.

  • RANGE_WITHIN

    Returns true if a date or date range falls within another date range.

  • TRANGE

    Filters data for a given time range using the @timestamp attribute.