Calculate precise time differences between two dates with multiple unit options. Access via MCP in Cursor or Windsurf, or GET /v1/datetime/diff REST endpoint. Returns differences in days, hours, minutes, seconds, or milliseconds. Perfect for deadline tracking, age calculations, or duration analytics in AI workflows.
curl "https://tinyfn.io/v1/datetime/diff" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/datetime/diff', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/datetime/diff',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's date/time tools:
{
"mcpServers": {
"tinyfn-datetime": {
"url": "https://tinyfn.io/mcp/datetime",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Send a GET request to /v1/datetime/diff with start_date and end_date parameters. The tool returns the difference in your specified unit (days, hours, minutes, seconds, or milliseconds).
Accepts ISO 8601 format (2024-01-15T10:30:00Z), Unix timestamps, and standard date strings. Always returns deterministic results regardless of input format.
Yes, the tool returns negative values when end_date is earlier than start_date. This is useful for detecting overdue deadlines or past events.
AI agents in Cursor or Cline can calculate project durations, sprint lengths, or deadline proximity. Combine with other datetime tools for comprehensive timeline analysis.
The tool performs UTC-based calculations for consistency. Convert dates to your target timezone before calling if timezone-aware differences are needed.