Subtracts specified time durations from datetime values with precision handling. Use via MCP in Cursor or REST at `/v1/time/subtract`. Pass a datetime and duration (hours, minutes, seconds, etc.) to get the calculated result. Handles timezone-aware calculations and maintains ISO 8601 formatting for reliable time arithmetic in AI workflows.
curl "https://tinyfn.io/v1/time/subtract" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/time/subtract', {
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/subtract',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
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"
}
}
}
}
Pass the datetime and specify duration parameters like hours=-2 and minutes=-30. The tool returns the calculated datetime in ISO 8601 format.
Yes, it preserves timezone information in the input datetime and performs calculations relative to that timezone, maintaining accuracy across DST boundaries.
Yes, you can combine years, months, days, hours, minutes, and seconds in a single subtraction operation for complex time calculations.
AI agents in Windsurf or Cline can calculate deadlines, schedule reminders, or determine time windows by subtracting durations from reference timestamps.
The tool handles edge cases gracefully, returning appropriate error messages for impossible dates while maintaining calculation accuracy for valid ranges.
Get your free API key and start using Subtract Time in seconds.
Get Free API Key