businessdate – Calculate business date from a given number of days

The businessdate service can be used to find a business date from a specified number of days.

You can choose if you want to calculate the business date by adding (default) or subtracting the given days, and whether or not a specific filter should be applied to the result. By default the result will be filtered on excluding weekends and public holidays, but you can specify a custom filter to modify this.

This service can be tested with the Query Builder.

Request Parameters. 

NameDescriptionRequired
placeid

Specify the ID of the location you would like to calculate the business date. The ID is used to find what holidays are applicable for the given place so the calculation can exclude or include those results.

Note: It is also possible to specify coordinates or IATA/ICAO codes for airports, see the documentation for the type Location Id for detailed information.

Type: String/Location Id

Condition: either the placeid or the country parameter has to be specified.

Conditional
country

Specify the country for which you would like to calculate the business date.

Type: String/ISO3166-1-alpha-2 country code

Condition: either the placeid or the country parameter has to be specified.

Conditional
state

Specify the state in the given country you want to calculate the business date.

Type: String/ISO3166-2 country state code

Condition: only if the country parameter has been specified.

Conditional
startdt

Specify the ISO 8601 date for the first date you are interested in.

Type: String/ISO8601 Date

Yes
days

Specify how many business days to count.

Note: The parameter will be sorted in ascending order (e.g. if the values 30,20,10 is passed as a parameter it will be sorted to 10,20,30).

Type: Integer/Array of integers

Example: 10,20

Yes
include

Specify whether the result should be calculated by including instead of excluding the days.

Type: Boolean

Default value: 0

No
filter

Choose a set of types or days you want to filter on.

Type: String/Array of Business Days Filter Type

Default value: weekendholidays

No
op

Set if the service should do an addition or subtraction of the specified days.

Type: String/Business Days Operator Type

Default value: add

No
repeat

Set how many times the calculation should be repeated (only applicable when days parameter has exactly one number).

Type: Integer

No
lang

The preferred language for the texts. An error will be raised if the language code cannot be recognized. In case the text for a specific event cannot be retrieved in the requested language it will be returned in English instead. This is also the default language.

In case you have specific needs for a certain language/translation, please email api@timeanddate.com.

Type: String/ISO639 Language Code

Default value: en

No
verbosetime

Adds verbose time specification to all ISO 8601 time stamps.

Type: Boolean

Accepted values: 0 or 1

Default value: 1

No

See also the section called “General Parameters”.

Response Elements. 

NameDescription
geo

Geographical information about the location.

Type: GeoType

period (XML), periods (JSON)

This array will contain the calculated result for the requested period. For the XML format, it will be repeated multiple times, while for JSON, it is modeled as an array of objects with the same content.

Type: Array of PeriodType

Example JSON Request. 

https://api.xmltime.com/businessdate?placeid=187&startdt=2015-04-01&days=18&version=2&out=json&prettyprint=1&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

Example JSON response

{
    "version": 2,
    "geo": {
        "latitude": 59.913055,
        "longitude": 10.740001,
        "name": "Oslo",
        "country": {
            "id": "no",
            "name": "Norway"
        },  
        "state": ""
    },  
    "periods": [{
        "includeddays": 18, 
        "calendardays": 29, 
        "skippeddays": 11, 
        "startdate": {
            "iso": "2015-04-01",
            "datetime": {
                "year": 2015,
                "month": 4,
                "day": 1
            }   
        },  
        "enddate": {
            "iso": "2015-04-30",
            "datetime": {
                "year": 2015,
                "month": 4,
                "day": 30
            }   
        },  
        "weekdays": {
            "type": "excluded",
            "count": 8,
            "mon": 0,
            "tue": 0,
            "wed": 0,
            "thu": 0,
            "fri": 0,
            "sat": 4,
            "sun": 4
        },  
        "holidays": {
            "type": "excluded",
            "count": 3,
            "list": [{
                "id": 1497,
                "urlid": "norway/maundy-thursday",
                "uid": "0005d900000007df",
                "url": "http://www.timeanddate.com/holidays/norway/maundy-thursday",
                "name": "Maundy Thursday",
                "date": {
                    "iso": "2015-04-02",
                    "datetime": {
                        "year": 2015,
                        "month": 4,
                        "day": 2
                    }   
                }   
            },{ 
                "id": 1498,
                "urlid": "norway/good-friday",
                "uid": "0005da00000007df",
                "url": "http://www.timeanddate.com/holidays/norway/good-friday",
                "name": "Good Friday",
                "date": {
                    "iso": "2015-04-03",
                    "datetime": {
                        "year": 2015,
                        "month": 4,
                        "day": 3
                    }   
                }   
            },{ 
                "id": 1500,
                "urlid": "norway/easter-monday",
                "uid": "0005dc00000007df",
                "url": "http://www.timeanddate.com/holidays/norway/easter-monday",
                "name": "Easter Day",
                "date": {
                    "iso": "2015-04-06",
                    "datetime": {
                        "year": 2015,
                        "month": 4,
                        "day": 6
                    }
                }
            }]
        }
    }]
}

Example XML Request. 

https://api.xmltime.com/businessdate?placeid=187&startdt=2015-04-01&days=18&version=2&out=xml&prettyprint=1&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

Example XML response

<?xml version="1.0" encoding="UTF-8"?>
<data version="2">
  <geo>
    <latitude>59.913055</latitude>
    <longitude>10.740001</longitude>
    <name>Oslo</name>
    <country id="no">Norway</country>
    <state></state>
  </geo>
  <period includeddays="18" calendardays="29" skippeddays="11">
    <startdate iso="2015-04-01">
      <datetime>
        <year>2015</year>
        <month>4</month>
        <day>1</day>
      </datetime>
    </startdate>
    <enddate iso="2015-04-30">
      <datetime>
        <year>2015</year>
        <month>4</month>
        <day>30</day>
      </datetime>
    </enddate>
    <weekdays type="excluded" count="8">
      <mon>0</mon>
      <tue>0</tue>
      <wed>0</wed>
      <thu>0</thu>
      <fri>0</fri>
      <sat>4</sat>
      <sun>4</sun>
    </weekdays>
    <holidays type="excluded" count="3">
      <list>
        <holiday id="1497" urlid="norway/maundy-thursday" uid="0005d900000007df" url="http://www.timeanddate.com/holidays/norway/maundy-thursday">
          <name>Maundy Thursday</name>
          <date iso="2015-04-02">
            <datetime>
              <year>2015</year>
              <month>4</month>
              <day>2</day>
            </datetime>
          </date>
        </holiday>
        <holiday id="1498" urlid="norway/good-friday" uid="0005da00000007df" url="http://www.timeanddate.com/holidays/norway/good-friday">
          <name>Good Friday</name>
          <date iso="2015-04-03">
            <datetime>
              <year>2015</year>
              <month>4</month>
              <day>3</day>
            </datetime>
          </date>
        </holiday>
        <holiday id="1500" urlid="norway/easter-monday" uid="0005dc00000007df" url="http://www.timeanddate.com/holidays/norway/easter-monday">
          <name>Easter Day</name>
          <date iso="2015-04-06">
            <datetime>
              <year>2015</year>
              <month>4</month>
              <day>6</day>
            </datetime>
          </date>
        </holiday>
      </list>
    </holidays>
  </period>
</data>

prev top | next >
Terms & Conditions Copyright © Time and Date AS
All data supplied by timeanddate.com