Time/Timezone Utilities

Calculate Age

Calculates precise age from birthdate using deterministic date arithmetic. Access via MCP in Cursor or Windsurf for instant age calculations, or call GET /v1/time/age with birthdate parameter. Returns years, months, days, and total days lived. Handles leap years and timezone-aware calculations automatically.

API Endpoint

GET /v1/time/age

Code Examples

curl "https://tinyfn.io/v1/time/age" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/time/age', {
  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/age',
    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 calculate someone's age using the MCP tool in Cursor?

Use the Calculate Age tool with a birthdate parameter like '1990-05-15'. It returns exact age in years, months, days, plus total days lived.

What date formats does the age calculator accept?

Accepts ISO 8601 formats like '1990-05-15', '1990-05-15T10:30:00Z', and common formats like 'May 15, 1990'. Always returns precise calculations.

Does the age calculation handle leap years correctly?

Yes, it accounts for leap years in both the birth year and intervening years. February 29th birthdays are handled properly for non-leap calculation years.

Can I get age calculations in different units besides years?

The tool returns a breakdown: complete years, remaining months, remaining days, and total days lived. Perfect for detailed age analysis in AI applications.

How does timezone affect age calculations?

Uses UTC by default for consistent results. If timezone is specified in the birthdate, calculations adjust accordingly to avoid off-by-one errors.

Try Calculate Age Now

Get your free API key and start using Calculate Age in seconds.

Get Free API Key