FunctionCopy link to clipboard
calworkhours( start_datetime, end_datetime, calendar_name )
This returns the actual number of work hours between two given Date and Times (both inclusive), according to the calendar defined for the system.
ParametersCopy link to clipboard
Keyword | Type | Description |
---|---|---|
|
Date and Time |
The starting Date and Time. |
|
Date and Time |
The ending Date and Time. |
|
Text |
This optional parameter accepts the name of a system calendar; otherwise, the default calendar is used. In a portal, this parameter is ignored. |
ReturnsCopy link to clipboard
Integer
Usage considerationsCopy link to clipboard
Passing a calendar name allows you to calculate working hours using an alternate system calendar, if you have multiple calendars configured.
See also: Process Calendar Settings
Autoscaled process models and application performanceCopy link to clipboard
Using this function in a process model with autoscale enabled may result in degraded site or application performance. It should be used with caution and tested thoroughly before deploying it for real-world use. When the application is in production, use the Autoscaled Process Activity tab to monitor how the process performs at scale.
ExamplesCopy link to clipboard
calworkhours(datetime(2011,12,20,12,0,0),datetime(2011,12,21,12,0,0))
returns 8
Feature compatibilityCopy link to clipboard
The table below lists this function's compatibility with various features in Appian.
Feature | Compatibility | Note |
---|---|---|
Portals | Compatible | |
Offline Mobile | Incompatible | |
Sync-Time Custom Record Fields | Compatible | Can be used to create a custom record field that only evaluates at sync time. |
Real-Time Custom Record Fields | Incompatible | Custom record fields that evaluate in real time must be configured using one or more Custom Field functions. |
Process Reports | Compatible | |
Process Events | Compatible | |
Process Autoscaling | Partially compatible | Using this function in a process model with autoscale enabled may result in degraded site or application performance. |