﻿---
title: ES|QL date-time functions
description: ES|QL supports these date-time functions: 
url: https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/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/151137/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/151137/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/151137/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/151137/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/151137/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/151137/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/151137/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/151137/reference/query-languages/esql/functions-operators/date-time-functions/now)
  Returns current date and time.

- [`TRANGE`](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/pull/151137/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.