Calculate Date Difference activity

An activity that lets you specify dates and times, and then uses your rules to makes calculations. This shape can change the operations between two date-time values, or add more time to a given date-time.


Calculate Date Difference activity

Configure the Calculate Date Difference activity

To configure the Calculate Date Difference activity, do the procedure in this topic.

Good to Know

How to Start

  1. Open Process Builder.

    For information about how to open this screen, refer to Process Builder.


    Open Process Builder
  2. In Process Builder, in the Activity Library, open the Utilities tab.

    Open Utilities tab
  3. On the Utilities tab , drag the Calculate Date Difference activity onto your process.

    Drag Calculate Date Difference activity

Procedure

  1. Complete the fields on the General Configuration screen.
  2. Click Calculate Date Difference Calculate Date Difference icon.
  3. Complete the fields on these screens.

    For more information, refer to Create a Complex Date Calculation.

  4. (Optional) Click Advanced Advanced icon > Email Notifications E-mail Notifications icon.

    For more information, refer to Email Notifications screen (Process Activities).

General Configuration

Specifies the basic settings for the Calculate Date Difference activity.

Figure: General Configuration screen

General Configuration screen

Fields

Field NameDefinition

Display Name

Function:
Specifies the activity name that shows in your process.
Accepted Values:
One line of text that can have spaces.
Default Value:
None
Accepts Process Data Variables:
No
Example:
This is a common configuration field that is used in many examples. Refer to:
  • Examples - Step-by-step use case examples, information about what types of examples are provided in the AgilePoint NX Product Documentation, and other resources where you can find more examples.

Description

Function:
Specifies an optional text description for your activity.
Accepted Values:
More than one line of text.
Default Value:
None
Accepts Process Data Variables:
No

Calculate Date Difference > Input Tab

Specifies your input values for date-time calculations.

Figure: Calculate Date Difference > Input tab

Calculate Date Difference Input tab

Fields

Field NameDefinition

Input Date Time

Function:
Specifies the reference date for your date calculation.

Two Date Time fields are available: Input Date Time 1 and Input Date Time 2.

Accepted Values:
  • Custom Attributes - Specifies a process data variable that stores the date-time value and your date-time format.

    You can use Process Data screen to specify a process data variable.

    You can also use a custom date-time format. For more information, refer to Customize Your Date-Time Format.

  • Static - Specifies a static date and time.
  • Now - The date and time the system activity starts at runtime.
Default Value:
Custom Attributes
Example:
Refer to:

Calculate Date Difference > Operation Tab

Specifies how to calculate your input date-time values.

Figure: Calculate Date Difference > Operation tab

Calculate Date Difference Operation tab

Fields

Field NameDefinition

Compare Difference

Function:
Specifies how to compare the difference between the two Input Date Time values.
Accepted Values:
  1. The operator used to compare the two Input Date Time values:
    • <= - Less than or equal to.
    • >= - Greater than or equal to.
    • = - Equals
    • <> - Not equal to.
  2. An integer, or a process data variable that stores an integer.

    You can use Process Data screen to specify a process data variable.

  3. The time unit.

    Options are:

    • Seconds
    • Minutes
    • Hours
    • Days
    • Weeks
    • Months
    • Years
Default Value:
None
Accepts Process Data Variables:
Yes

Return

Function:
Specifies the earlier or later value for Input Date Time 1 or Input Date Time 2.
Accepted Values:
  • Whichever is Earlier - Uses the earlier of Input Date Time 1 and Input Date Time 2.
  • Whichever is Later - Uses the later of Input Date Time 1 and Input Date Time 2.
Default Value:
Whichever is Earlier

My Organization's Business Time

Function:
Specifies to use your work calendar for date calculations.
To Open this Field:
  1. On the Email Notifications screen, click the Reminder tab.
Accepted Values:
  • Deselected - Uses your work calendar for calculations.
  • Selected - Does not use your work calendar for calculations.
Default Value:
Deselected
Example:
The Business Time field is set as selected, and business hours of work calendar are configured as 9 AM to 5 PM. If the task with completion time 8 hours is entered at 1 PM on Monday, then the task must be completed by 12 PM on Tuesday.

Calculation Type

Function:
Specifies how the difference between the Input Date Time 1 and Input Date Time 2 is calculated.
Accepted Values:
  • Real - The actual difference between the two DateTime values. The result depends upon the option set in the Result field.
  • Relative - The relative difference between the two DateTime values. This setting is useful for situations when an action is allowed, for example, once per week or once per month.
Default Value:
Real
Example:
The difference between the dates Sat 29-Dec-2007 23:50:00 and Wed 02-Jan-2008 00:00:00 is calculated as follows. Note that these dates are 4 days apart, but occur in different years, different months, and different weeks.
  • When you select the Real option the difference is calculated based on the actual number of days (and hours and minutes) between the two dates: 4 days and 10 minutes.
  • When you select the Relative option, the difference is 4 days, 1 week or 1 month, or 1 year, depending upon the time unit specified.

Calculate Date Difference > Output Tab

Specifies your output values for a date-time calculation.

Figure: Calculate Date Difference > Output tab

Calculate Date Difference Output tab

Fields

Field NameDefinition

Result Boolean

Function:
Specifies the name of the variable that stores the Boolean result returned from the Compare Difference date calculations.

If the Compare Difference option is enabled, the difference is evaluated as a Boolean result, and the Boolean value is associated with the variable that appears in this field.

Accepted Values:
A process data variable that stores a Boolean Date Time result.
Default Value:
None
Accepts Process Data Variables:
Yes

Date String

Function:
Specifies the process data variable that stores the result received from the date calculations if it is in the Date Time format.

The results of the date calculations that changes from the Date Time format to a String. The format of the string is specified in the list.

Accepted Values:
A process data variable that stores the result in the selected String format.
Default Value:
None
Accepts Process Data Variables:
Yes
Example:
Refer to:

Difference

Function:
Specifies the result returned from the Compare Difference date calculations. In terms of a number of time units, such as 5 seconds, or 10 days.

If Compare Difference is enabled, the difference is stored as a variable with the name that appears in this field. The value is the output value of the comparison.

Accepted Values:
  • A process data variable that stores the value of the comparison result.
  • The time unit.

    Options are:

    • Seconds
    • Minutes
    • Hours
    • Days
    • Weeks
    • Months
    • Years
Default Value:
  • None
  • Days
Accepts Process Data Variables:
Yes

Result

Function:
Specifies the type of value to return for the date calculations where the Calculation Type is set as Real.
Accepted Values:
  • Decimal - Returns the difference as is, including any decimals.
  • Whole Number - Returns the integer part of the result by removing the decimal part.
  • Rounded - Rounds up (>=0.5) or rounds down (<0.5) the result.
Default Value:
None

Test Mode

Function:
Lets you see if your settings give the necessary result before you run the process.
Accepted Values:
  • Deselected - Test mode is disabled.
  • Selected - Test mode is enabled.
Default Value:
Deselected

Test

Function:
Runs a test to validate the specified date-time settings.