---
title: " Subtract Date Step"
url: "https://docs.robotiq.ai/en/article/subtract-date-step"
language: "en"
last_updated: "2025-12-24T14:55:56.680Z"
---

#  Subtract Date Step

The Subtract Date step figures out the difference between two dates and times. It gives you the answer in a format you pick, like days or hours. You can save this difference to a new or existing variable.

## How to Use the Subtract Date Step

Use this step to find how much time passes between two specific moments.

### Step 1: Add the Subtract Date Step

1.  Open your process in the Robotiq.ai Process Editor.
2.  Drag the **Subtract Date** step into your workflow.

### Step 2: Set Up Input Parameters

1.  **Subtract date:** Pick an existing datetime variable, or use the date/time picker to type in a specific date and time. This is the value that gets subtracted.
2.  **From date:** Pick an existing datetime variable, or use the date/time picker to type in a specific date and time. This is the value you're subtracting from.
3.  **Get difference in:** Choose the unit for your result.
    -   Seconds
    -   Minutes
    -   Hours
    -   Days
    -   Months
    -   Years

### Step 3: Set Up Output Variable

1.  **Difference:** Type the name of an existing integer variable or make a new one. This variable will hold the calculated difference.

## Parameters Explained

**Step name** (Optional)

-   A custom name for this step in the Process Editor.

**Subtract date** (Required)

-   The date and time value to subtract.
-   Example: `2023-01-15 10:00:00` or a variable like `{{startDate}}`.
-   You can pick a value from a date/time picker or use a variable.

**From date** (Required)

-   The date and time value you're subtracting from.
-   Example: `2023-01-20 12:00:00` or a variable like `{{endDate}}`.
-   You can pick a value from a date/time picker or use a variable.

**Get difference in** (Required)

-   The unit for the calculated difference.
-   Options: `Seconds`, `Minutes`, `Hours`, `Days`, `Months`, `Years`.
-   Example: If you pick `Days`, the output will be the number of days between the two dates.

**Difference** (Required)

-   The variable where the calculated difference will be saved. This variable must be an integer.
-   Example: `{{timeDifference}}`.
-   You can use an existing variable or make a new one.

## Related Articles

-   [Define Variable Step - Robotiq.ai Help Center](https://docs.robotiq.ai/en/article/define-variable-step)
-   [Set Variable Value Step - Robotiq.ai Help Center](https://docs.robotiq.ai/en/article/set-variable-value-step)

## Need Help?

Can't find what you're looking for? Join the [Robotiq Community](https://community.robotiq.ai/home/) to get help from other users and the Robotiq team.

![](https://cdn-assets.productfruits.com/aa115f46-4df7-4c81-a33c-a38cf871d169)
