How to Compare Dates Using the "Compare Datetimes" Helper

Keragon’s Compare Datetimes action allows you to easily compare two datetime values and determine their relationship. This is useful for validating deadlines, checking if events occurred before or after a specific time, and automating date-based logic in your workflows.

How to Use the Compare Datetimes Helper

00:00: This guide will walk you through comparing dates using the compare datetimes helper 00:04: action in caragon. 00:13: Click on the specified location. 00:16: Navigate to the helpers section. 00:19: Access the date and time helpers option. 00:22: Select the option for compare datetimes. 00:25: Choose the start date field and fill in the desired daytime value. 00:30: Select the end date field and fill in the desired, daytime value. 00:35: Set the desired. Start date format. 00:41: Set the desired end date format. 00:47: Select the appropriate start date time zone. 00:50: Select the appropriate start date time zone. 00:53: Click on Save. 00:56: Select test step. 00:59: Choose outputs. 01:02: The guide covered the process of comparing dates using the compare datetimes helper 01:06: action.

  • Open your workflow editor.

  • Click the + icon to add a new step.

  • In the step selection panel, click "Helpers".

  • From the Helpers options, select "Date and Time Helpers".

  • Choose the "Compare Datetimes" action.

  • Click the Start Date field.

  • Use the Variable Selector to map the start datetime value.

  • Click the End Date field.

  • Use the Variable Selector to map the end datetime value.

  • Set the Start Date Format field to match the format of the input start datetime.

  • Set the End Date Format field to match the format of the input end datetime.

  • (Optional) Set the timezones for Start Date Timezone and End Date Timezone fields. Defaults to UTC.

  • Click "Save" to apply changes.

  • Click "Test Step" to preview the result.

  • Go to the Outputs tab to view the comparison result.

Output Values:

  • -1: Start Date is before End Date.

  • 0: Start Date is equal to End Date.

  • 1: Start Date is after End Date.

Example Result:

  • Start Date: "2024-07-01T10:00:00Z"

  • End Date: "2024-07-05T10:00:00Z"

  • Output: -1 (Start Date is before End Date)

Was this article helpful?
0 out of 0 found this helpful

Articles in this section

See more