Geolocation Utilities

Timezone Offset

Estimates timezone offset from longitude coordinates using the rough approximation of 15 degrees per hour. Access via MCP in Cursor or Windsurf, or hit GET /v1/geo/timezone-offset with longitude parameter. Returns UTC offset in hours — useful for quick timezone calculations when you have coordinates but need approximate local time. Not daylight saving aware.

API Endpoint

GET /v1/geo/timezone-offset

Code Examples

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

response = requests.get('https://tinyfn.io/v1/geo/timezone-offset',
    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 geolocation tools:

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

Learn more about MCP setup →

FAQ

How accurate is longitude-based timezone offset estimation?

Rough approximation using 15°/hour rule. Good for ballpark estimates but ignores political boundaries, daylight saving time, and timezone irregularities like China's single timezone.

What's the formula for calculating timezone offset from longitude?

UTC offset ≈ longitude ÷ 15. So longitude -75° (New York area) gives approximately -5 hours UTC offset.

Can I use this MCP tool to estimate meeting times across locations?

Yes, but only for rough estimates. Feed coordinates to get approximate offsets, then calculate time differences. Consider using precise timezone APIs for production scheduling.

Does the timezone offset account for daylight saving time?

No, returns standard UTC offset only. Add 1 hour manually during DST periods, or use a full timezone database for DST-aware calculations.

What longitude range does the timezone offset endpoint accept?

Standard longitude range: -180 to +180 degrees. Values outside this range may wrap around or return errors depending on implementation.

Try Timezone Offset Now

Get your free API key and start using Timezone Offset in seconds.

Get Free API Key