# DATE_PARSE

The DATE_PARSE function returns a date by parsing a string using the format specified in the first argument.

## Syntax

`DATE_PARSE(datePattern, dateString, options, time_zone, locale)`

### Parameters

#### datePattern

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

#### dateString

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

#### options

Optional. Additional options for date parsing, allowing you to specify time zone and locale as function named parameters.

#### time_zone

Coordinated Universal Time (UTC) offset or IANA time zone used to convert date values in the query string to UTC.

#### locale

The locale to use when parsing the date, relevant when parsing month names or week days.

## Examples

Parse a date string in the format "yyyy-MM-dd" and convert it to a date value.
```esql
ROW date_string = "2022-05-06"
| EVAL date = DATE_PARSE("yyyy-MM-dd", date_string)
```
Calculate a date value from a string formatted as "yyyy-MM-dd".
