Skip to content

Date Builder Expressions ​

The Date Expression variable method sets a variable to a date worked out when the workflow runs, such as "the next business day that isn't a holiday" or "the last Sunday of the month". You can use it anywhere variables are set: triggers, edges and application templates.

To build one, open the Edit Variable dialog, set Method to Date Expression, and click Edit. The Date Variable builder opens.

Date Variable - Calendar Days

A date expression is a starting date followed by a list of changes. Situate applies the changes in order, top to bottom.

Starting Date ​

Start with can be:

  • Today. Today at midnight.
  • Tomorrow. Tomorrow at midnight.
  • Yesterday. Yesterday at midnight.
  • Now. The current time.
  • Existing Variable. The date in the variable named in the Variable field.

Changes ​

The Then make these changes list shows each change in words, for example "Add 1 day". Use + to add a change and − to remove the selected one. The arrows move the selected change up or down, which changes the result, since changes are applied in order.

Select a change to set it up: pick its Method on the left, then its options on the right.

Actions ​

Every method except Minutes Adjust works with a set of days. Calendar Days uses every day; the others use the days you choose (for example, Monday to Friday except holidays). Each change starts with an action:

ActionWhat it doesCount
AddCounts forward that many days in the set. The date you start from isn't counted, even if it's in the set, so the result is always laterRequired
SubtractCounts backward that many days in the set. The result is always earlierRequired
Round UpKeeps the date if it's already in the set; otherwise moves forward to the next day in the setNot used
Round DownKeeps the date if it's already in the set; otherwise moves back to the previous day in the setNot used

For example, with the set "Monday to Friday":

Starting onAdd 1 daySubtract 1 dayRound UpRound Down
FridayMondayThursdayFridayFriday
SaturdayMondayFridayMondayFriday

Use Round Up or Round Down for "this day if it qualifies, otherwise the nearest one that does", such as "today, or the next business day if today is a weekend or holiday". Use Add or Subtract to count days, such as "two business days from today".

Calendar Days only offers Add and Subtract, since every day is in its set. The day methods don't change the time of day; use Minutes Adjust for that.

Methods ​

Calendar Days ​

Calendar Days adds or subtracts days, counting every day. The example above adds one day.

Business Days ​

Business Days counts only the days of the week you check under Using days in..., and skips days in a calendar if you check but not days in the and pick the calendar. This lets business days skip holidays.

Date Variable - Business Days

Here, the change adds one business day: Monday through Friday, skipping days in the US_Holidays calendar. To get the most recent business day before today, start with Today and subtract one business day instead.

Monthly/Dates ​

Monthly/Dates counts only certain dates of the month. Enter the dates in The ... day(s) of months (for example, 1, 15), check Include the last day of the month if you want it, and check the months to use.

Date Variable - Monthly/Dates

Here, the change moves to the next 15th or last day of the month, in any month.

Monthly/Week Days ​

Monthly/Week Days counts only a certain weekday in a certain week of the month, such as "the second Sunday" or "the last Friday". Pick the week (First through Fifth, or Last) and the weekday, and check the months to use.

Date Variable - Monthly/Week Days

Here, the change moves to the next last Sunday of a month.

Minutes Adjust ​

Minutes Adjust changes the time of day. Use it after the other changes, for example to make a date 2:30 AM instead of midnight.

ActionWhat it doesExample, starting at 9:07 with 15 minutes
AddAdds the number of minutes. Passing midnight moves to the next day9:22
SubtractSubtracts the number of minutes. Passing midnight moves to the previous day8:52
Round UpMoves the time forward to the next multiple of that many minutes after midnight. A time already on a multiple is kept9:15
Round DownMoves the time back to the previous multiple of that many minutes after midnight. A time already on a multiple is kept9:00

Rounding also drops any seconds.

Date Variable - Minutes Adjust

Here, the change adds 30 minutes.

Click OK to save the date expression and return to Edit Variable, which shows it as text.

Workload Automation and Orchestration