Skip to content

Get Date Function: date

The HuLoop Get Date function is a versatile feature that automates date-related tasks in workflows. It allows you to calculate dates dynamically, compare date ranges, and validate date formats based on specified parameters. You can use this function to track deadlines, verify date ranges, and generate dates for scheduling, ensuring consistency and accuracy in processes that depend on date operations.

Commands under Get Date Function

Add Days Date: adddaysdate

The adddaysdate command retrieves a date based on the provided parameters, allowing you to get past, current, or future dates. This command is helpful for scenarios requiring dynamic date calculations in automation workflows.

  • Days To Add: Determines the date offset.
    1. 0 retrieves the current date from the system.
    2. A positive value (e.g., 10) retrieves a future date.
    3. A negative value (e.g., -5) retrieves a past date.
  • Date Format: Specifies the desired format for the date. Supported formats include:
    • MM/dd/yyyy (e.g., 12/23/2024)
    • dd/MM/yyyy (e.g., 23/12/2024)

Example: You need to get a date 10 days from today in the format dd/MM/yyyy.

Steps to Configure:

  1. Select Set a Variable Value from the Action dropdown.
  2. In the Element Key field, enter a variable name (e.g., DateVariable). This variable will store the calculated date.
  3. Click on Form to open the configuration form.
    • From the dropdown, select Functions and choose Get Date function.
    • Provide the following parameters:
      • Action: Select adddaysdate from the Action drop-down menu.
      • Days to Add: Enter the adjustment days based on the required date, e.g., 10.
      • Date Format: Specify the format in which the date should appear (e.g., MM/dd/yyyy or dd/MM/yyyy).
  1. Click Save.
scrn-get-date-tabular-view
Tabular View
scrn-get-date-card-view
Card View

Outcome on Execution

  • The variable defined in the Element Key (e.g., DateVariable) will store the calculated date in the specified format.
  • You can reference this variable in subsequent steps of your automation process using the syntax ${VariableName} (e.g., ${DateVariable}).

Days’ Difference: daysdiff

The daysdiff command calculates the number of days between two specified dates. It is particularly useful for date comparisons, such as determining the duration between events or validating date ranges in automation workflows.

Example: You need to calculate the number of days between January 1, 2025, and January 10, 2025.

Steps to Configure

  1. Select Set a Variable Value from the Action dropdown.
  2. In the Element Key field, enter a variable name (e.g., DaysDifferenceResult). This variable will store the calculated difference in days between the two dates.
  3. Click on Form to open the configuration form.
    • From the dropdown, select Functions and choose Get Date Function.
    • Provide the following parameters:
      • Action: Select daysdiff from the Action dropdown menu.
      • startdate: Enter the start date for the calculation (e.g., 01/01/2025).
      • enddate: Enter the end date for the calculation (e.g., 01/10/2025).
      • DateFormat: Specify the format of the dates provided (e.g., MM/dd/yyyy).
  4. Click Save.
scrn-days-diff-tabular-view
Tabular View
scrn-days-diff-card-view
Card View

Outcome on Execution:

  • The difference in days between the two specified dates will be stored in the variable defined in the Element Key (e.g., DaysDifferenceResult).
  • You can reference this variable in subsequent steps of your automation process using the syntax ${Variablename} (e.g., ${DaysDifferenceResult}).
  • Ensure Consistent Date Formats: Use the same format for startdate, enddate, and DateFormat to avoid calculation errors.
  • Negative Differences: If the startdate is later than the enddate, the result will be negative. Use this feature to identify reversed date ranges if needed.

Back To Top