Free cookie consent management tool by TermsFeed caladdhours() Function
caladdhours() Function

Tip:  Check out the new Date and Time function a!addDateTime(). It does everything caladdhours() does but offers more flexibility. You can also use the new a!subtractDateTime() function to subtract an increment of time from a specified start date.

Function

caladdhours( start_datetime, number, calendar_name )

This function adds a given number of hours to a Date and Time plus any non-working hours (as designated on the process calendar) and returns the resulting Date and Time.

Parameters

Keyword Type Description

start_datetime

Date and Time

The starting Date and Time.

number

Integer

The number of net work hours to be added to the starting Date and Time.

calendar_name

Text

This optional parameter accepts the name of a system calendar; otherwise, the default calendar is used.

Returns

Date and Time

Usage considerations

General considerations

The function only returns Date and Time values that fall within the working time defined in the process calendar.

It also calculates results across daylight saving time boundaries.

This function is commonly used in process events, like Start Events or Timer Events.

Using the start_datetime parameter

If the start_datetime value is a non-working time, adding 0 hours returns the same Date and Time given as the start_datetime; adding 1 or more hours returns the next working time plus that many work hours.

Using the calendar_name parameter

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

Examples

caladdhours(datetime(2011,12,13,12,0,0),12) returns 12/14/2011 4:00 PM GMT +00:00

Feature compatibility

The table below lists this function's compatibility with various features in Appian.
Feature Compatibility Note
Portals Incompatible
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
Process Reports Compatible
Process Events Compatible

caladdhours() Function

FEEDBACK