Reference > Expressions > Built-in Functions > System Functions > HOPCalcTargetDate

HOPCalcTargetDate

Calculates the end date and time based on a start date, hours of operation (HOP) schedule, and an interval.

This function takes into account the calendar defined by the reference HOP. The HOP is based on the tenant rather than the server configuration.

Syntax

HOPCalcTargetDate(scheduleName, startDateTime, intervalSeconds)

Enabled for

Search/Dashboard No
Business Rules Yes
Quick Actions Yes
Workflow Objects Yes
Reports No

Parameters

scheduleName

The HOP schedule name as defined (for example, 24x7 or 9 to 5). See Setting Up Hours of Operation.

startDateTime

The starting date and time.

intervalSeconds

(Optional) The interval in seconds. If this parameter is not used, it defaults to 0, which means that it returns the very first second of the next work period (operating interval).

 

You can use basic math operations to calculate the seconds or you can use an expression.

Return Value

DateTime value.

Example

$(HOPCalcTargetDate("Weekly HOP", CurrentDateTime(), ((12 * 60) * 60)))

This example calculates the date and time for 12 operating hours from the current date and time using the HOP schedule called Weekly HOP.