We Use Cookies

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with this.

See our cookie policy.

Automation Action: Date Operation

Perform various operations on date values.

Built-In Action

Perform various operations on dates.

Select the Date Operation Type:

OperationType Details
Get Date Extract the date from any text or variable and return it to another variable in a predefined format. Enable the Convert To UTC option to convert the date to UTC.
Get Time Extract just the time from any text or variable and return it to another variable in a predefined format.
Get Date and Time Extract the date and time from any text or variable and return it to another variable in a predefined format.
Get Interval Calculates an Interval between a From and To date and returns the value to a variable. The Interval can be Seconds, Minutes, Hours, Days, Weeks, Months or Years. The interval can be returned as a number or duration text. Select from the Interval Format option. If Short Duration is selected then for interval will be returned as hh:mm:ss format. Long Duration will return as x Hours, x Minutes, x Seconds (depending on the Interval type).
Add To Adds an interval Value to an existing date/time extracted from any text or variable and returns the new date time to a variable in a predefined format.
Subtract From Subtracts an interval Value to an existing date/time extracted from any text or variable and returns the new date time to a variable in a predefined format.
Get Date and Time From Unix Timestamp Get the date and time from a Unix timestamp. A Unix timestamp is a number representing the number of seconds since 1st Jan 1970.
Get Unix Timestamp From Date and Time. Gets the Unix timestamp from a date.
Get Year, Month, Day, Hour, Minute, Second Get a specific date part from any date/time.

Select the variable to receive the result from the Assign To Variable list.

When extracting and formatting dates you can select the Locale. This will default to the system locale.

Formatting

You can use this action to change the format of an existing date %variable% or extract a specific part of a datetime and assign it to a different variable. Use the Get Date and Time operation. Set the From to the variable containing the date. Enter or select the required Format. Select the same variable from the Assign To Variable list if you want to update the existing variable.

See: Custom date and time format strings | Microsoft Docs for available Format strings.