Transform Datetimes to Relative Time Using the "Transform to Relative Time" Helper

Keragon’s Transform to Relative Time action converts a datetime into a human-readable relative time format. Instead of absolute dates, this action returns results like "4 years ago" or "in 1 year". This is especially useful for creating user-friendly messages, timelines, and notifications.

How to Use the Transform to Relative Time Helper

00:00: This guide will walk you through on how to transform date times to relative 00:04: time. In Kerrigan, this action transforms, an input date 00:08: time value to relative time for example, for years 00:12: ago, or in one year, 00:15: First. Go to your workflow editor. 00:20: Click the plus icon. 00:23: Navigate to the helper section in the menu. 00:26: Access the date and time helpers option. 00:29: Choose the transform to relative time action. 00:33: Select the daytime value field and set the date that you want to compare to the 00:37: current date time or a custom date time. 00:40: Set the date or time format of the input value in the format of date-time 00:44: value field. 00:46: Optional, we can configure the following drop-down Fields. 00:49: UTC will be used in the time zone of date, time value field, 00:53: and the value false and return, relative value without the suffix field 00:57: by default. 01:00: Select true or false in the compared with a custom. 01:03: Now, filled if falls are, by default comparison of daytime 01:07: date will be with current daytime. If true. 01:10: A from date, should be provided, new Fields will be populated to 01:14: set this. 01:16: Save the changes made. 01:19: Click the test, step button. 01:22: Click the outputs Tab and view the generated relative time. 01:26: This guy covered transforming Day times to relative time using karigon.

  • 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 "Transform to Relative Time" action.

  • Click the Datetime Value field.

  • Use the Variable Selector to map the datetime value you want to transform.

  • Set the Format of Datetime Value field to match the format of the input datetime.

  • (Optional) Configure:

    • Timezone of Datetime Value (Defaults to UTC).

    • Return Relative Value Without the Suffix:

      • True: Returns relative time without suffix (e.g., "4 years").

      • False: Returns full relative time (e.g., "4 years ago").

  • Set Compare with a Custom Now to True or False:

    • False (Default): Compares against the current datetime.

    • True: Provides a custom comparison datetime (additional fields will appear).

  • Click "Save" to apply changes.

  • Click "Test Step" to preview the result.

  • Go to the Outputs tab to view the relative time result.

Example Results:

  • Input Datetime: "2022-06-01T10:00:00Z"

  • Output: "2 years ago"

  • Input Datetime: "2026-01-01T00:00:00Z"

  • Output: "in 1 year"

 

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

Articles in this section

See more