Returns the number of working seconds between two DateTime values.
DiffWorkingSeconds(hopIdOrName, utcStart, utcEnd)
For a description of the business object categories, see Notes on "Enabled For".
|Business Object Category||Yes/No|
|Business Rules: Before-Save Rules||Yes|
|Business Rules: Calculation Rules (After Save, with or without Also Recalculate on Load)||Yes|
|Business Rules: Calculation Rules (Before Save or Always, without Also Recalculate On Load)||Yes|
|Business Rules: Calculation Rules (Before Save or Always, with Recalculate On Load)||Yes|
|Business Rules: Editing Rules||Yes1|
|Business Rules: Initialization Rules||Yes|
|Business Rules: Read Only Rules||No|
|Business Rules: Required Rules||Yes1|
|Business Rules: Validation Rules||Yes|
|Quick Actions (except UI Quick Actions)||Yes|
|UI Quick Actions||No|
|Search/Dashboard without field references||Yes|
|Search/Dashboard with field references||No|
|1. Except when this field appears on a form or is triggered by such a field.|
|hopIdOrName||The hours of operation schedule name (for example, 24x7 or 9 to 5) that determines the working and non-working schedule. See Setting Up Hours of Operation.|
The start date and time to be compared.
|utcEnd||The end date and time to be compared.|
If the value of the utcEnd parameter is later than the value of the utcStart parameter, the returned value is positive. If the value of the utcStart parameter is earlier than the value of the utcEnd parameter, the returned value is negative.
$(DiffWorkingSeconds("24 x 7", "4/5/2015 11:36 AM", "4/6/2015 11:36 AM"))
returns the number of seconds in a working day, which in this case is 28,800 seconds (8 hours x 60 minutes x 60 seconds), assuming that there are no exceptions during that time defined in the HOP schedule.
Was this article useful?
Copyright © 2019, Ivanti. All rights reserved.