# DATE_FORMAT

The `DATE_FORMAT` function returns a string representation of a date in the specified format.

## Syntax

`DATE_FORMAT(dateFormat, date)`

### Parameters

#### `dateFormat`

- **Optional**
- Specifies the date format. If no format is provided, the default format `yyyy-MM-dd'T'HH:mm:ss.SSSZ` is used.
- If `null`, the function returns `null`.

#### `date`

- A date expression.
- If `null`, the function returns `null`.

## Examples

Formatting a date to `yyyy-MM-dd`

```esql
FROM employees
| KEEP first_name, last_name, hire_date
| EVAL hired = DATE_FORMAT("yyyy-MM-dd", hire_date)
```

This example formats the `hire_date` field into the `yyyy-MM-dd` format and stores the result in a new column named `hired`.
