﻿---
title: ES|QL date-time functions
description: ES|QL supports these date-time functions: 
url: https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions
products:
  - Elasticsearch
applies_to:
  - Elastic Cloud Serverless: Generally available
  - Elastic Stack: Generally available
---

# ES|QL date-time functions
ES|QL supports these date-time functions:
- [`DATE_DIFF`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/date_diff)
  Returns the difference between two timestamps in the specified unit.
- [`DATE_EXTRACT`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/date_extract)
  Extracts parts of a date, like year, month, day, hour.
- [`DATE_FORMAT`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/date_format)
  Returns a string representation of a date, in the provided format.
- [`DATE_PARSE`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/date_parse)
  Parses a string into a date using the specified format.
- [`DATE_TRUNC`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/date_trunc)
  Rounds down a date to the closest interval.
- [`DAY_NAME`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/day_name) <applies-to>Elastic Stack: Generally available since 9.2</applies-to>
  Returns the name of the weekday for a date.
- [`MONTH_NAME`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/month_name) <applies-to>Elastic Stack: Generally available since 9.2</applies-to>
  Returns the month name for a date.
- [`NOW`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/now)
  Returns current date and time.
- [`RANGE_CONTAINS`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/range_contains) <applies-to>Elastic Stack: Planned</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Returns true if a date range contains a given date or sub-range.
- [`RANGE_INTERSECTS`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/range_intersects) <applies-to>Elastic Stack: Planned</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Returns true if two date ranges or dates overlap.
- [`RANGE_MAX`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/range_max) <applies-to>Elastic Stack: Planned</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Returns the end value of a date range.
- [`RANGE_MIN`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/range_min) <applies-to>Elastic Stack: Planned</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Returns the start value of a date range.
- [`RANGE_WITHIN`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/range_within) <applies-to>Elastic Stack: Planned</applies-to> <applies-to>Elastic Cloud Serverless: Preview</applies-to>
  Returns true if a date or date range falls within another date range.
- [`TRANGE`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/152901/reference/query-languages/esql/functions-operators/date-time-functions/trange) <applies-to>Elastic Stack: Generally available since 9.3</applies-to>
  Filters data for a given time range using the @timestamp attribute.