date_parse.asciidoc 801 B

12345678910111213141516171819202122232425262728293031323334353637
  1. [discrete]
  2. [[esql-date_parse]]
  3. === `DATE_PARSE`
  4. *Syntax*
  5. [source,esql]
  6. ----
  7. DATE_PARSE([format,] date_string)
  8. ----
  9. *Parameters*
  10. `format`::
  11. The date format. Refer to the
  12. https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/time/format/DateTimeFormatter.html[`DateTimeFormatter`
  13. documentation] for the syntax. If `null`, the function returns `null`.
  14. `date_string`::
  15. Date expression as a string. If `null` or an empty string, the function returns
  16. `null`.
  17. *Description*
  18. Returns a date by parsing the second argument using the format specified in the
  19. first argument.
  20. *Example*
  21. [source.merge.styled,esql]
  22. ----
  23. include::{esql-specs}/docs.csv-spec[tag=dateParse]
  24. ----
  25. [%header.monospaced.styled,format=dsv,separator=|]
  26. |===
  27. include::{esql-specs}/docs.csv-spec[tag=dateParse-result]
  28. |===