Business Duration Service

This service will calculate the number of business days or non-working days for a country from a specified range of dates.

The only thing you need to supply in order to get started with this service is a location (either a place or a country), a start date and an end date. If you choose to query this service with a country you can also specify a state in the given country. When calculating the number of business days in a given date range, the service will take into consideration the specific holidays applicable for the given state and exclude or include them depending on your query.

Filters

You may want to supply several different filters to choose what kind of data should be included or excluded. If you only want to filter on weekends and holidays you do not need to change anything about the filter as this is the default behavior. But should you want to also filter out Mondays and Thursdays you need only to specify it in your query and the calculated result will take your specific needs into consideration.

Flexible Queries

It is entirely up to you how you want to design your query. The Business Duration Service allows you to customize a range of options for your convenience.

Exclude or Include

When queried the service will use the filter to exclude weekends, holidays and what else you might have specified in your query. If you instead want the service to include, rather than exclude, the filter you can specify this with a boolean parameter in your query! For example, if you want to find the number of business days in a date range and you only consider weekends as business days you could choose to include the filter instead of excluding it.

Other Options

By default when you query the service it will not assume you want to include the end date in the calculation. If you want to override this option you can just specify the parameter for include last date and you will get an additional day added.

Holidays and Affected Days

In addition to calculating the number of days in the period you requested, you will also get a list of the holidays which occur in that duration. The holidays will be specific to the place or country you chose for your query. If you use a country as a parameter, you can also select a state to be included in the calculations. When you then send a request, the service will also look at state-specific holidays instead of only national holidays.

For your convenience, the service will also return an object showing which days have been included or excluded in your result. For example, a query might exclude 8 days where 4 are Saturdays and 4 Sundays.

Data Coverage

List all supported countries

Sample Data

Example Request: https://api.xmltime.com/businessduration?placeid=187&startdt=2015-04-01&enddt=2015-04-30&version=2&out=json&prettyprint=1&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

{
    "version": 2,
    "geo": {
        "latitude": 59.913055,
        "longitude": 10.740001,
        "name": "Oslo",
        "country": {
            "id": "no",
            "name": "Norway"
        },  
        "state": ""
    },  
    "period": {
        "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 Request: https://api.xmltime.com/businessduration?placeid=187&startdt=2015-04-01&enddt=2015-04-30&version=2&out=xml&prettyprint=1&accesskey={KEY}&expires={TIMESTAMP}&signature={SIGNATURE}

<?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 result="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>
Terms & Conditions Copyright © Time and Date AS
All data supplied by timeanddate.com