# Extract date information

The Extract date information step allows to extract date information from a date column (e.g. the `year` or the `month`).

### Step parameters

* `Date column` **column(string)\***: specify the date column to extract information from (the column must be of date data type),
* `Date information to extract...` **array(string)\***: the type of information to extract (e.g. `year`, `month`). You can select several information to extract at once.

### Example

**Input**

<figure><img src="/files/ZIsLAKGeZ8rrOntv1haq" alt=""><figcaption><p>Date - Extract date information</p></figcaption></figure>

**Configuration**

```json
{
  "column": "date_column",
  "date_info": ["year", "month", "days"],
}
```

**Output**

<figure><img src="/files/ppQemeZn0yhMeKeY9PcW" alt=""><figcaption><p>Date - Extract date information output</p></figcaption></figure>

{% hint style="info" %}
The following information can be extracted:

* `year'`: extract ‘year’ from date,
* `month`: extract ‘month’ from date,
* `day`: extract ‘day of month’ from date,
* `week`: extract ‘week number’ (ranging from 0 to 53) from date,
* `quarter`: extract ‘quarter number’ from date (1 for Jan-Feb-Mar)
* `day of week`: extract ‘day of week’ (ranging from 1 for Sunday to 7 for Staurday) from date,
* `day of year`: extract ‘day of year’ from date,
* `ISO year`: extract ‘year number’ in ISO 8601 format (ranging from 1 to 53) from date.
* `ISO week`: extract ‘week number’ in ISO 8601 format (ranging from 1 to 53) from date.
* `ISO day of week`: extract ‘day of week’ in ISO 8601 format (ranging from 1 for Monday to 7 for Sunday) from date,
* `first day of year`: calendar date corresponding to the first day (1st of January) of the year ,
* `first day of month`: calendar date corresponding to the first day of the month,
* `first day of week`: calendar date corresponding to the first day of the week,
* `first day of quarter`: calendar date corresponding to the first day of the quarter,
* `first day of ISO week`: calendar date corresponding to the first day of the week in ISO 8601 format,
* `previous day`: calendar date one day before the target date,
* `first day of previous year`: calendar date corresponding to the first day (1st of January) of the previous year,
* `first day of previous month`: calendar date corresponding to the first day of the previous month,
* `first day of previous week`: calendar date corresponding to the first day of the previous week,
* `first day of previous ISO week`: calendar date corresponding to the first day of the previous ISO week,
* `first day of previous quarter`: calendar date corresponding to the first day of the previous quarter,
* `previous year number`: extract previous ‘year number’ from date,
* `previous month number`: extract previous ‘month number’ from date,
* `previous week number`: extract previous ‘week number’ from date,
* `previous quarter number`: extract previous ‘quarter number’ from date,
* `previous ISO week number`: extract previous ‘week number’ in ISO 8601 format (ranging from 1 for Monday to 7 for Sunday)from date,
* `hour`: extract ‘hour’ from date,
* `minutes`: extract ‘minutes’ from date,
* `seconds`: extract ‘seconds’ from date,
* `milliseconds`: extract ‘milliseconds’ from date,
  {% endhint %}


---

# 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-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/overview-of-youprep-tm/date/extract-date-information.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.
