For the complete documentation index, see llms.txt. This page is also available as Markdown.

Manipulate a date

The Manipulate a date helper allows you to change a date by either adding or subtracting time units (years, days, hours and minutes), typically used for scheduling and record-keeping purposes.

The helper takes a date or timestamp and the amount of time (in years, days, hours or minutes) to add or subtract. It returns the updated date or timestamp.

Common use-cases

Manipulate a date options

The table presents various options for manipulating a date using the Manipulate a date tool.

It's based on an initial input set as Sunday, February 14th, 2010, at 3:25:50 pm:

Add/Subtract
Time unit
Amount of time
Example Output

Subtract

Days

5

2010-02-08T22:00:00.000Z

Add

Hours

23

2010-02-15T12:25:50.000Z

Subtract

Years

5

2005-02-14T13:25:50.000Z

Subtract

Years

7

2016-05-28T11:10:16.000Z

Example 1 - Creating a due date

Let’s say you want to create a feature that creates a task due in a week:

Task
Current day

Send email to Ben

March 14, 2023

Step-by-step instructions

You can create a new date seven days from today using the Manipulate a date helper:

  1. Add the action Manipulate a date

  2. Map the current date into the date input (found under Runtime & user attributes).

  3. Choose Add (Add/Subtract), Days (Time unit), and 7 (Amount of time).

  4. The helper will return the date exactly one week from today, which can be used as the due date for your tasks:

Task
Current day
Due date

Send email to Ben

March 14, 2023

March 21, 2023

Example 2 - Displaying calendar events within a timeframe

Let’s say you want to present your meetings and calls from the last 7 days. Use Search events in your calendar app (e.g. Google Calendar) to get a list of events in a user-defined timeframe. The action requires From date and To date values.

Step-by-step instructions

You can use the current time as the To date and run a Manipulate a date action to create the From date:

  1. Add the Manipulate a date action.

    1. Map the current date into the date input (found under Runtime & user attributes).

    2. Choose Subtract, Days, and 7.

The output is the date seven days ago, and can be used as the beginning of the timeframe.

  1. Add the Search events action.

    1. Choose the calendar you want to search the events in.

    2. Map the previous step’s output in to From date.

    3. Map the current date in to To date (found under Runtime & user attributes).

The output of this step includes all the events from the past seven days.

Last updated