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.

  • TRANGE

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