# Compute duration

The Compute duration step allows to compute the duration (in days, hours, minutes or seconds) between 2 dates in a new column.

### Step parameters

* `New column name`**(string\*)**: the new column to be created for the computation result
* `Start date column` **column(string)\***: the starting date
* `End date column` **column(string)\***: the ending date
* `Duration in` **(integer)\*:** the duration units (days, hours, minutes or seconds)

### Example

**Input**

<figure><img src="/files/ZIsLAKGeZ8rrOntv1haq" alt=""><figcaption><p>Date - compute duration</p></figcaption></figure>

**Configuration**

```json
{
  "new_column_name": "compute_duration",
  "start_date_col": "start_date",
  "end_date_col": "end_date",
  "duration_in": "days",
}

```

**Output**

<figure><img src="/files/4DL1vgeJ3JNYBJ8xgrqt" alt=""><figcaption><p>Date - compute duration output</p></figcaption></figure>


---

# 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/compute-duration.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.
