BUSINESS_HOURS_ADD

Description

Adds a time interval to a starting Datetime, counting only business hours. The result is returned in GMT.

Syntax

BUSINESS_HOURS_ADD(start_date, interval_milliseconds, business_hours_name_optional) -> Datetime

Parameters

ParameterData TypeRequiredDescription
start_dateDatetimeYesThe starting Datetime.
interval_millisecondsLongYesThe interval to add, specified in milliseconds.
business_hours_name_optionalStringNoThe name of the business hours. If omitted, the default schedule is applied.

Examples

BUSINESS_HOURS_ADD(CreatedDate, 8 * 60 * 60 * 1000)
-- Returns a Datetime 8 business hours after CreatedDate.
BUSINESS_HOURS_ADD(ClosedDate, -5 * 8 * 60 * 60 * 1000, "Weekday9to5" )
-- Returns a Datetime 5 business days before ClosedDate using "Weekday9to5" hours.