Time/Timezone Utilities

Add Time

Adds specified time intervals (seconds, minutes, hours, days, etc.) to any datetime input. Use via MCP in Cursor or Windsurf for schedule calculations, or call GET /v1/time/add with datetime and interval parameters. Returns ISO 8601 formatted results. Handles timezone-aware operations and leap years correctly.

API Endpoint

GET /v1/time/add

Code Examples

curl "https://tinyfn.io/v1/time/add" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/time/add', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/time/add',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's time/timezone tools:

{
  "mcpServers": {
    "tinyfn-time": {
      "url": "https://tinyfn.io/mcp/time",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I add 3 hours and 30 minutes to a datetime using the time add tool?

Pass your datetime and specify hours=3, minutes=30 as parameters. The tool accepts multiple time units simultaneously and returns the calculated result in ISO format.

Does the add time function handle timezone conversions correctly?

Yes, it preserves the original timezone and accounts for DST transitions. If you add time that crosses a DST boundary, the result reflects the correct local time.

Can I use negative values to subtract time instead of add?

Yes, negative values work for any time unit (days=-1, hours=-2). This makes it versatile for both forward and backward time calculations.

How can MCP agents use this for deadline and scheduling calculations?

AI agents in Cursor or Cline can call this tool to calculate project deadlines, meeting times, or SLA expiration dates without manual date arithmetic errors.

What time units are supported for adding to datetime values?

Supports years, months, weeks, days, hours, minutes, seconds, and milliseconds. You can combine multiple units in a single operation for complex time adjustments.

Try Add Time Now

Get your free API key and start using Add Time in seconds.

Get Free API Key