Skip to main content

Add/subtract time

Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

Add (or subtract) a specific number of seconds, minutes, hours or days to a datetime value. This command allows you to manipulate date and time values by adding or subtracting a specified time unit, making it useful for date calculations in workflows.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

Original datetime

Specify the datetime value to alter

-

Yes

Select a datetime variable or enter text in commonly used formats

Adjustment

Choose to add or subtract to datetime

Add, Subtract

Yes

-

Amount to adjust

Enter the amount of time to add or subtract

-

Yes

Must be a numeric value

Unit

Select a time unit

Second(s), Minute(s), Hour(s), Day(s), Month(s), Year(s)

Yes

-

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action produces a datetime variable that contains the result of adding or subtracting the specified time amount from the original datetime.


Using Variables in Conditions

You can use variables in the "Original datetime" and "Amount to adjust" parameters by clicking the {x} icon. This allows you to reference previously defined variables in your workflow. For example, you could use a variable that contains a user-provided date or dynamically calculated time value.

When using variables, ensure that:

  • The variable used for "Original datetime" contains a valid datetime value

  • The variable used for "Amount to adjust" contains a numeric value


Notes

  • The command supports various datetime formats for the input value

  • When working with months or years, be aware of edge cases such as adding a month to January 31st (which could result in February 28th or 29th depending on leap years)

  • Time zone information in the original datetime will be preserved in the output

  • Invalid datetime formats or non-numeric values for the adjustment amount will cause errors

  • This command is useful for scheduling tasks, calculating deadlines, or determining time-based conditions in your automation workflows

Did this answer your question?