Choose where you’d like to start

workday()

Overview

The workday() function takes dateTimeValue and numberOfBusinessDays as arguments. It returns the dateTimeValue after adding the specified number of business days to it.

The date value (without time value) will be returned in the format specified in Application Settings.

Return Type

  • Date-Time

Syntax

<variable> = <dateTimeValue>.workday( <numberOfBusinessDays>, [<weekends>], [<holidays>]);

(OR)

<variable> = workday(<dateTimeValue>, <numberOfBusinessDays>, [<weekends>], [<holidays>]);
ParameterData typeDescription
<variable>DATE-TIMEVariable which will contain the returned date value.
<dateTimeValue>DATE-TIME

The date-time value to which the specified number of business days will be added.

The time value is not taken into account while using this function.

A runtime error will be encountered if:

  • the hour value, or minute value, or second value, is specified in more than 2 digits.
  • the date value exceeds the number of days in that month.
  • an incorrect month value is specified.
  • the year value has more than 4 digits.

Please refer this help document to learn about the supported date-time formats.

Note: 

  • In services other than Zoho Creator, the value of this parameter can be entered either as a text or as a date-time value.
  • In Zoho Creator, the value of this parameter can be entered only as a date-time value.
<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

  • By default, the weekends list is {Saturday, Sunday}
holidays
(optional)
COLLECTION
(OF DATES)

The list of holidays that should be considered while adding business days.

Note

  • If no holidays are provided, any day (except weekends) will be considered a working day.

Examples

 currentDate = '15-Mar-2019';
 newDate = currentDate.workday(1); // returns '18-Mar-2019';
 
newDate = zoho.currentdate.workday(5, {"Sunday"}, {'25-May-2020'});          
// assuming the current date is 23-May-2020, this task returns '30-May-2020'

Get Started Now

Execute