MCP Servers/Date Calculator

Date Calculator

utilities

active

Comprehensive date calculations with arithmetic, differences, age, business days, and formatting

datecalendarutilitiestimeschedulingagebusiness-daystimezone

API Access Requires Subscription

While you can view all details here, using this MCP server's API requires a Enterprise subscription. API calls with FREE plan keys will return an access error.

View Pricing Plans

Available Tools

add_to_date

tool

Add time units (years, months, weeks, days, hours, minutes, seconds) to a date. Supports business days calculation with weekend and holiday exclusion.

calculate_age

tool

Calculate detailed age from a birth date including years, months, days, and total time in various units.

calculate_date_difference

tool

Calculate the difference between two dates with comprehensive breakdown including years, months, days, business days, and age statistics.

format_date

tool

Convert a date to different formats and timezones with optional metadata.

subtract_from_date

tool

Subtract time units from a date. Supports business days calculation with weekend and holiday exclusion.

Documentation

Integration Guide

MCP Client Setup

Add the Date Calculator MCP server to your MCP client configuration:

{
  "mcpServers": {
    "date-calculator": {
      "command": "curl",
      "args": [
        "-X", "POST",
        "https://apistack.online/api/mcp/utilities/date-calculator/sse",
        "-H", "Content-Type: application/json",
        "-H", "Authorization: Bearer YOUR_API_KEY",
        "--data-raw", "@-"
      ],
      "transport": "sse"
    }
  }
}

Replace YOUR_API_KEY with your APIStack API key from the Dashboard.

Usage Examples

Example 1: Add Time to Date

// Add 30 days to January 1, 2024
const result = await mcpClient.callTool('add_to_date', {
  date: '2024-01-01',
  value: 30,
  unit: 'days',
  outputFormat: 'readable'
});

Example 2: Calculate Age

// Calculate age from birth date with metadata
const result = await mcpClient.callTool('calculate_age', {
  date: '1990-05-15',
  includeMetadata: true
});

Example 3: Calculate Date Difference

// Calculate difference with business days
const result = await mcpClient.callTool('calculate_date_difference', {
  date: '2024-01-01',
  targetDate: '2024-12-31',
  country: 'US'
});

Code Examples

Code Examples

JavaScript Example

// Date Calculator MCP Client Example
const response = await fetch('https://apistack.online/api/mcp/utilities/date-calculator/sse', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer YOUR_API_KEY'
    },
    body: JSON.stringify({
        jsonrpc: '2.0',
        id: 'req-1',
        method: 'tools/call',
        params: {
            name: 'add_to_date',
            arguments: {
                date: '2024-01-01',
                value: 30,
                unit: 'days',
                outputFormat: 'iso'
            }
        }
    })
});

const result = await response.json();
console.log(result);

Python Example

# Date Calculator MCP Client Example
import requests

response = requests.post(
    'https://apistack.online/api/mcp/utilities/date-calculator/sse',
    headers={
        'Content-Type': 'application/json',
        'Authorization': 'Bearer YOUR_API_KEY'
    },
    json={
        'jsonrpc': '2.0',
        'id': 'req-1',
        'method': 'tools/call',
        'params': {
            'name': 'calculate_age',
            'arguments': {
                'date': '1990-05-15',
                'includeMetadata': True
            }
        }
    }
)

result = response.json()
print(result)

cURL Example

# Date Calculator MCP Client Example
curl -X POST https://apistack.online/api/mcp/utilities/date-calculator/sse \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "jsonrpc": "2.0",
    "id": "req-1",
    "method": "tools/call",
    "params": {
        "name": "calculate_date_difference",
        "arguments": {
            "date": "2024-01-01",
            "targetDate": "2024-12-31",
            "country": "US"
        }
    }
}'

Subtract Time Example

// Subtract 6 months from a date
const response = await fetch('https://apistack.online/api/mcp/utilities/date-calculator/sse', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer YOUR_API_KEY'
    },
    body: JSON.stringify({
        jsonrpc: '2.0',
        id: 'req-2',
        method: 'tools/call',
        params: {
            name: 'subtract_from_date',
            arguments: {
                date: '2024-06-15',
                value: 6,
                unit: 'months',
                timezone: 'America/New_York'
            }
        }
    })
});

const result = await response.json();
console.log(result);

Quick Info

Endpoint
/api/mcp/utilities/date-calculator/sse
Transport
Server-Sent Events (SSE)
Tools Available
5
Plan Required
PRO, ENTERPRISE

MCP Configuration

Add this configuration to your MCP client:

Note: Replace "YOUR_API_KEY" with a valid Enterprise API key. FREE plan keys will receive access errors.

{
  "mcpServers": {
    "date-calculator-utilities": {
      "command": "curl",
      "args": [
        "-X",
        "POST",
        "https://apistack.online/api/mcp/utilities/date-calculator/sse",
        "-H",
        "Content-Type: application/json",
        "-H",
        "Authorization: Bearer YOUR_API_KEY",
        "--data-raw",
        "@-"
      ],
      "transport": "sse"
    }
  }
}

Try It Out

Use the MCP configuration above in your AI client, or test the underlying APIs in our playground.

API playground requires a Enterprise subscription for access.

Open in Playground