# Compare Date

This is a pre-built Action located under the **@Generic Element**. The functionality of this Action in Avo Assure is to compare two given dates that follow the same format. The comparison result stores in a dynamic variable.

## Syntax

**Input Value**: `<date1>;<date2>;<date1 format>`

| Argument                             | Description                                                                                                                                                            |
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<date1><br>(Required)</p>        | Provide the first date for comparison.                                                                                                                                 |
| <p>\<date2><br>(Required)</p>        | Provide the second date for comparison.                                                                                                                                |
| <p>\<date1 format><br>(Required)</p> | <p>Provide the format of the first date.</p><p> Supported date formats are:</p><ul><li>dd/MM/yyyy</li><li>MM/dd/yyyy</li><li>dd/MMM/yyyy</li><li>MMM/dd/yyyy</li></ul> |

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

| Argument                                                    | Description                                                       |
| ----------------------------------------------------------- | ----------------------------------------------------------------- |
| \<Dynamic Variable>(Required);< Dynamic Variable>(Optional) | Both dynamic variables store the status as **True** or **False**. |

### **Example:** Comparing Dates

In this example, we explain how to compare two given dates to determine if a particular date.

* **Action**: Compare Date
* **Input Value**: 11/12/2025;11/12/2025;dd/MM/yyyy
  * The first argument (**11/12/2025**) specifies the current date.
  * The second argument (**11/12/2025**) specifies the date to compare against.
  * The third argument (**dd/MM/yyyy**) specifies the current format of the input dates.
* **Output Value**: {Status}
  * The execution status (True) is stored in this **{Status}** dynamic variable with the following possible values:
    * **True**: If the comparison is successful.
    * **False**: If the operation fails due to an invalid date or format.

**Logical Explanation**: The **Compare Dates** action fetches the value from the **Input Value** column (**11/12/2025;11/12/2025;dd/MM/yyyy**), compares the two dates, and stores the outcome in the **{Status}** variable as (True).

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2F6al0wBwymjC9FZiB8kre%2Fimage.png?alt=media&#x26;token=96bf65f4-8ff0-42f1-b81c-3bf2520d4f20" alt=""><figcaption></figcaption></figure>

#### **Knowledge Bites:**&#x20;

Here are some examples of the different date formats:

<table><thead><tr><th>Date formats </th><th width="370.60009765625">Input Value</th><th>Result </th></tr></thead><tbody><tr><td>dd/MM/yyyy</td><td>08/11/2025;10/11/2025;dd/MM/yyyy</td><td>False</td></tr><tr><td>MM/dd/yyyy</td><td>11/05/2025;11/06/2025;MM/dd/yyyy</td><td>False</td></tr><tr><td>dd/MMM/yyyy</td><td>11/Nov/2025;11/Nov/2025;dd/MMM/yyyy</td><td>True</td></tr><tr><td>MMM/dd/yyyy</td><td>Nov/11/2025;Nov/11/2025;MMM/dd/yyyy</td><td>True</td></tr></tbody></table>
