# DATE_PARSE

Parses a date string into a date object using the specified format.

## Syntax

`DATE_PARSE(datePattern, dateString)`

### Parameters

#### `datePattern`

The date format. Refer to the `DateTimeFormatter` documentation for the syntax. If `null`, the function returns `null`.

#### `dateString`

A date expression as a string. If `null` or an empty string, the function returns `null`.

## Examples

Parsing a date string

```esql
ROW date_string = "2022-05-06"
| EVAL date = DATE_PARSE("yyyy-MM-dd", date_string)
```

This example parses the string `"2022-05-06"` into a date object using the format `"yyyy-MM-dd"`.
