Date time actions

Use the Get current date and time action to retrieve the current date and time (or date only, if selected) and store it in a variable. The date format depends on the Windows configuration. To find more information about the syntax of date and time values, go to Variable data types.

To add various time units to date variables, deploy the Add to datetime action.

To calculate the difference between two dates, use the Subtract dates action. You can retrieve the difference in seconds, minutes, hours, or days.

Screenshot of the Subtract dates action.

Add to datetime

Adds (or subtracts) a specific number of seconds, minutes, hours or days to a datetime value.

Input parameters

Argument Optional Accepts Default Value Description
Datetime No Datetime The datetime value to alter
Add No Numeric value The numeric value to add. To subtract a time, the value should be negative. For example, add -7 days here to go back one week
Time unit N/A Seconds, Minutes, Hours, Days, Months, Years Seconds The time unit the time to add represents

Variables produced

Argument Type Description
ResultedDate Datetime The new, altered datetime value

Exceptions

This action doesn't include any exceptions.

Subtract dates

Finds the time difference between two given dates in days, hours, minutes, or seconds.

Input parameters

Argument Optional Accepts Default Value Description
From date No Datetime The datetime to subtract the first datetime from. This will be the base datetime, so generally put the later date/time in this attribute
Subtract date No Datetime The datetime to subtract
Get difference in N/A Seconds, Minutes, Hours, Days Days The unit of time to express the difference in

Variables produced

Argument Type Description
TimeDifference Numeric value The difference in time as a numeric value

Exceptions

This action doesn't include any exceptions.

Get current date and time

Retrieves the current date or the current date and time.

Input parameters

Argument Optional Accepts Default Value Description
Retrieve N/A Current date and time, Current date only Current date and time Specify whether to get the date and time, or just the date. If the latter is chosen, the time value will be stored as midnight (0:00:00)
Time zone N/A System time zone, Specific time zone System time zone Whether to use the system's time zone or a custom one
Country/region No Text value Europe/Bucharest The country/region to get the time of or add a numeric value as the hours that will be added in the UTC time zone

Variables produced

Argument Type Description
CurrentDateTime Datetime The current datetime value

Exceptions

Exception Description
Failed to get current date and time Indicates that there was a problem retrieving the current date and time
Specified country/region not found Indicates that the specified country or region wasn't found