# DATE_FORMAT

The DATE_FORMAT function returns a string representation of a date using the specified format. If no format is provided, it defaults to `yyyy-MM-dd'T'HH:mm:ss.SSSZ`.

## Syntax

`DATE_FORMAT(dateFormat, date)`

### Parameters

#### dateFormat

Optional. Specifies the date format to use. If not provided, the default format is `yyyy-MM-dd'T'HH:mm:ss.SSSZ`. If set to `null`, the function returns `null`.

#### date

The date expression to format. If set to `null`, the function returns `null`.

## Examples

Formats the `hire_date` column as a string in the `yyyy-MM-dd` format and adds it as a new column called `hired`:

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