> For the complete documentation index, see [llms.txt](https://docs.onum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onum.com/pipelines/actions/transformation/date-operations.md).

# Date Operations

{% hint style="info" %}
See the changelog of this Action type [here](/actions-changelog/json-transformation.md).
{% endhint %}

## Overview

Perfrom a list of operations on date fields.

{% hint style="warning" %}
In order to configure this Action, you must first link it to a Listener. Go to [Building a Pipeline ](/pipelines/building-a-pipeline.md)to learn how to link.
{% endhint %}

## Ports

These are the input and output ports of this Action:

<details>

<summary>Input ports</summary>

* **Default port** - All the events to be processed by this Action enter through this port.

</details>

<details>

<summary>Output ports</summary>

* **Default port** - Events are sent through this port if no error occurs while processing them.
* **Error port** - Events are sent through this port if an error occurs while processing them.

</details>

## Configuration

{% stepper %}
{% step %}
Find **Date Operations** in the **Actions** tab (under the **Transformation** group) and drag it onto the canvas.
{% endstep %}

{% step %}
To open the configuration, click the Action in the canvas and select **Configuration**.
{% endstep %}

{% step %}
Choose one of the available **Operations** and configure it as required:

<table><thead><tr><th width="173.21875">Operation</th><th>Parameter</th><th data-hidden></th></tr></thead><tbody><tr><td><strong>Add duration</strong></td><td><ul><li><strong>Timestamp</strong> - Select the field from the Listener or Action that contains the timestamp value.</li><li><strong>Duration</strong> - Select the field from the Listener or Action that contains the duration value.</li><li><strong>Unit</strong> - Select the unit of measurement (milliseconds, seconds, minutes, hours, days) used to calculate the new date.</li><li><strong>Output field</strong> - Give a name to the output field with this new value.</li></ul></td><td></td></tr><tr><td><strong>Subtract duration</strong></td><td><ul><li><strong>Timestamp</strong> - Select the field from the Listener or Action that contains the timestamp value.</li><li><strong>Duration</strong> - Select the field from the Listener or Action that contains the duration value.</li><li><strong>Unit</strong> - Select the unit of measurement (milliseconds, seconds, minutes, hours, days) used to calculate the new date.</li><li><strong>Output field</strong> - Give a name to the output field with this new value.</li></ul></td><td></td></tr><tr><td><strong>Timestamp difference</strong></td><td><ul><li><strong>Timestamp</strong> - Select the field from the Listener or Action that contains the timestamp value.</li><li><strong>Timestamp 2</strong> - Select the field from the Listener or Action that contains the timestamp to compare against.</li><li><strong>Result Unit</strong> - Select the unit of measurement (milliseconds, seconds, minutes, hours, days) used to calculate the new date.</li><li><strong>Output field</strong> - Give a name to the output field with this new value.</li></ul></td><td></td></tr></tbody></table>
{% endstep %}

{% step %}
Click **Save** to complete the process.
{% endstep %}
{% endstepper %}
