# Date Difference

This is a pre-built Action located under the **@Generic Element**. The functionality of this Action in Avo Assure is to find the difference between a given date and a specified number of days or between two given dates. The calculated date or number of days is then stored in a dynamic variable.

## Syntax

**Input Value**: `<date>;<number of days OR date>;<current date format>`&#x20;

| Argument                                       | Description                                                                                                                                                              |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>\<date><br>(Required)</p>                   | Provide the starting date.                                                                                                                                               |
| <p>\<number of days OR date><br>(Required)</p> | Provide either the number of days to add or a target date for calculation.                                                                                               |
| <p>\<current date format><br>(Required)</p>    | <p>Provide the format of the starting date.<br>Supported date formats are:</p><ul><li>dd/MM/yyyy</li><li>MM/dd/yyyy</li><li>MMM/dd/yyyy</li><li>dd/MMM/yyyy   </li></ul> |

**Output Value**: `<Dynamic Variable>;<Dynamic Variable>(Optional)`

| Argument                                 | Description                                                                                                                                                          |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<Dynamic Variable><br>(Required)</p> | This dynamic variable stores the calculated difference in days or the resulting date after comparing the given date with a specified number of days or another date. |
| <p>\<Dynamic Variable><br>(Optional)</p> | This dynamic variable stores the status as **True** or **False**.                                                                                                    |

### Example: Finding Difference Between Day

In this example, we explain how to find the difference between a given day and a specified number of days or between two given dates.  &#x20;

* **Action**: Date Difference
* **Input Value**: 15/03/2025;10;dd/MM/yyyy
  * The first argument (**15/03/2025**) specifies the original date.
  * The second argument (**10**) specifies the number of days to add/subtract or the second date for comparison.
  * The third argument (**dd/MM/yyyy**) specifies the current format of the input date.
* **Output Value**: {Calculated Date}
  * The resulting date or number of days (05/03/2025) is stored in this **{Calculated Date}** dynamic variable.
  * If a second output variable is provided, the action returns the status as True/False:
    * **True**: If the calculation is successful.
    * **False**: If the operation fails due to an invalid date or format.
* **Logical Explanation**: The **Date Difference** action fetches the value from the **Input Value** column **(15/03/2025;20;dd/MM/yyyy**), calculates the difference based on the specified number of days or the second date, and stores the resulting date or number of days in the **{Calculated Date}** variable.

<figure><img src="/files/HLEpvMNKWIFNBtgYwvmM" alt=""><figcaption></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.avoautomation.com/avo-assure/actions/generic/date-operations/date-difference.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.
