Using the Add action

Use the Add action to increase the value in the Datetime variable by a specified time value and unit. For example, you can use this action to increase the Datetime variable value by three hours or by three days.

Procedure

To add a value to a Datetime variable, do the following:

  1. Double-click or drag the Add action from the Datetime node in the Actions palette.
  2. Select an option from the Source date and time variable list to specify the variable that contains the value to which you want to add the time unit.
  3. Enter the value you want to add in the Time value to add field.
  4. Select an option from the Time unit to add list to specify the time unit you want to add.
    Choose from the following time unit options:
    • Milliseconds
    • Seconds
    • Minutes
    • Hours
    • Days
    • Weeks
    • Months
    • Years
    Note: This action accounts for leap years. For example, if the action adds 28 days to February 1, 2020, the action output is February 29, 2020. Whereas, if the action adds 28 days to February 1, 2019, the action output is March 1, 2019.
  5. Select the Datetime variable from the Assign the output to a variable list to specify the variable to which you want to assign the output.
  6. Click Save.

Next steps

To see the output value, convert the value in the Datetime variable to a String variable, then print the value with the Message Box action. For more information, see Using the To string action and Using the Message box action.