Automation Action – Date Operation | ThinkAutomation
Automation Action: Date Operation
Perform various operations on date values.
Perform various operations on dates. This action forms part of ThinkAutomation’s broader workflow automation software, enabling automated workflows to extract, format, compare and calculate dates and times for use in scheduling, time-based processing and business rules.
Automate Date and Time Processing
ThinkAutomation can automatically extract and manipulate dates and times contained within emails, documents, database records, API responses and other business data. Dates can be reformatted into a consistent format, converted to UTC or broken down into individual elements such as year, month, day, hour or minute.
Date calculations can also be performed automatically, allowing workflows to calculate the time between two dates or add and subtract days, weeks, months or years from an existing date.
Select the Date Operation Type:
| Operation Type | 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. For the Format entry you can select one of the pre-defined formats, or type a specific format string.
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.
This is one action from over 180 actions included with ThinkAutomation. The ThinkAutomation business process automation (BPA) solution is designed to automate on-premises and cloud-based business processes that are triggered from incoming messages. Automate messages received by email, database automation, webhooks, web forms, web chat, SMS messages, Twitter, Teams messages, documents, local files and other messages sources. Create any number of workflow automations using the drag-and-drop low-code designer. Simple fixed pricing, with unlimited message processing reduces overall costs compared to hosted automation solutions.You can also extend ThinkAutomation by creating your own custom automation actions using the built-in designer and C#/VB.net code editor.