date_format.asciidoc 660 B

1234567891011121314151617181920212223242526272829303132333435
  1. [discrete]
  2. [[esql-date_format]]
  3. === `DATE_FORMAT`
  4. *Syntax*
  5. [source,esql]
  6. ----
  7. DATE_FORMAT([format,] date)
  8. ----
  9. *Parameters*
  10. `format`::
  11. Date format (optional). If no format is specified, the
  12. `yyyy-MM-dd'T'HH:mm:ss.SSSZ` format is used. If `null`, the function returns
  13. `null`.
  14. `date`::
  15. Date expression. If `null`, the function returns `null`.
  16. *Description*
  17. Returns a string representation of a date, in the provided format.
  18. *Example*
  19. [source.merge.styled,esql]
  20. ----
  21. include::{esql-specs}/date.csv-spec[tag=docsDateFormat]
  22. ----
  23. [%header.monospaced.styled,format=dsv,separator=|]
  24. |===
  25. include::{esql-specs}/date.csv-spec[tag=docsDateFormat-result]
  26. |===