Business Date Service

This service will calculate the number of business days or non-working days for a country from a starting date to a specified number of days.

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 a number of business days you want to count to. If you choose to query this service with a country you can also specify a state in the given country. When finding out the business date 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 need into consideration.

Flexible queries

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

Addition or subtraction

The service will assume that you are interested in finding the business date by adding a number of business days to a given start date. There is, however, nothing stopping your from choosing to subtracting rather than adding the given number of days: Use the operator parameter!

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 instance, if you want to find the last business date and you also want to consider weekends as business days you could choose to include the filter instead of excluding it.

Getting multiple results

By either using repetition parameters or specifying a list of days you want to calculate the business date from, you can get multiple results in one single query.

Using repetition will make the service calculate the days you specified a number of times giving you multiple results for each date. On the other hand, if you rather want a variable number of days, say you are interested in the business date 10 and 20 days from now you can specify that as well.

Holidays and affected days

In addition to finding the business date from the number of business days you requested, you will also get a list of the holidays which occur in that period. The holidays will be specific to the place or country you chose for your query. If you use a country as parameter you can also specify a state for which the calculations should take into account. 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 instance a query might exclude 8 days where 4 are on a Saturday and 4 are on a Sunday.

Data Coverage

List all supported countries

Sample Data

Example 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}

{
    "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 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}

<?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