addBusinessDay()
Table of Contents
Overview
The addBusinessDay() function takes dateTimeValue and numberOfBusinessDays as arguments. It returns the dateTimeValue after adding the specified number of business days to it.
Note: Monday to Friday, irrespective of any day being a holiday, are considered as business days.
The date-time value will be returned in the format specified in Application Settings.
Return Type
- Date-Time
Syntax
<variable> = <dateTimeValue>.addBusinessDay(<numberOfBusinessDays>, [<weekends>], [<holidays>]);
(OR)
<variable> = addBusinessDay(<dateTimeValue>, <numberOfBusinessDays>, [<weekends>], [<holidays>]);
Parameter | Data type | Description |
variable | DATE-TIME | Variable which will contain the returned date-time value. |
dateTimeValue | DATE-TIME | The date-time value to which the specified number of business days will be added. The date-time value can be specified without a time value, in which case 00:00:00 will be taken as the default time value. If the hour value is specified as 24 or more, the date-time value be reset to 00:00:00. If the minutes value is specified as 60 or more, the mm:ss value will be reset to 00:00, if the seconds value is specified as 60 or more, the ss value will be reset to 00. A runtime error will be encountered if:
Refer this help document to learn about the supported date-time formats. |
numberOfBusinessDays | NUMBER | The number of business days to be added to dateTimeValue. A negative number will return the given date-time value as it is. |
weekends (optional) | COLLECTION (OF TEXT) | The list of weekends that should be considered while adding business days. Note
|
holidays (optional) | COLLECTION (OF DATES) | The list of holidays that should be considered while adding business days. Note
|
Examples
newDate = currentDate.addBusinessDay(1); // returns '18-Mar-2019' which is Monday
// assuming the current date is 23-May-2020, this task returns '30-May-2020'