elasticsearch/docs/reference/esql/functions/date_format.asciidoc
Abdon Pijpelink 8e0d4e1846
[DOCS] Improve ES|QL functions reference for functions A-D (#103447)
* Functions starting with A

* Functions starting with 'C'

* More 'C' functions

* Fix tests

* Fix missing snippet

* DATE_* functions

* Apply suggestions from code review

Co-authored-by: Bogdan Pintea <pintea@mailbox.org>

---------

Co-authored-by: Bogdan Pintea <pintea@mailbox.org>
2023-12-19 15:59:02 +01:00

35 lines
660 B
Text

[discrete]
[[esql-date_format]]
=== `DATE_FORMAT`
*Syntax*
[source,esql]
----
DATE_FORMAT([format,] date)
----
*Parameters*
`format`::
Date format (optional). If no format is specified, the
`yyyy-MM-dd'T'HH:mm:ss.SSSZ` format is used. If `null`, the function returns
`null`.
`date`::
Date expression. If `null`, the function returns `null`.
*Description*
Returns a string representation of a date, in the provided format.
*Example*
[source.merge.styled,esql]
----
include::{esql-specs}/date.csv-spec[tag=docsDateFormat]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/date.csv-spec[tag=docsDateFormat-result]
|===