# FORMAT\_DATE

### Description

`FORMAT_DATE` formats a given date, from either an information or a text in [ISO8601 format](/rule-language/operators/date-operators.md#iso8601-format), into the specified format. There might be two documents that ask for a different date format, e.g. `28.02.2022` vs. `02-28-2022`. The given format can contain the following options:

| Option | Description                               |
| ------ | ----------------------------------------- |
| `D`    | Days without leading zero, e.g. 7 or 13   |
| `DD`   | Days with leading zero, e.g. 07 or 13     |
| `M`    | Months without leading zero, e.g. 2 or 11 |
| `MM`   | Months with leading zero, e.g. 02 or 11   |
| `YYYY` | The year, e.g. 1987 or 2021               |

### Example: German Format

```
FORMAT_DATE('2022-02-28', 'DD.MM.YYYY')
```

This returns `28.02.2022`.

### Example: US Format

```
FORMAT_DATE('2022-02-28', 'MM-DD-YYYY')
```

This returns `02-28-2022`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/operators/date-operators/format_date.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
