Time/Timezone Utilities

Unix To Datetime

Converts Unix timestamps to human-readable datetime strings with timezone support. Use via MCP in Cursor or Windsurf, or call GET /v1/time/unix-to-datetime directly. Pass timestamp 1640995200 to get "2022-01-01 00:00:00 UTC". Handles millisecond precision and custom timezone formatting for reliable datetime operations in AI workflows.

API Endpoint

GET /v1/time/unix-to-datetime

Code Examples

curl "https://tinyfn.io/v1/time/unix-to-datetime" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/time/unix-to-datetime', {
  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/unix-to-datetime',
    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 convert Unix timestamp to datetime using MCP?

Call the unix-to-datetime tool with your timestamp. It returns formatted datetime strings with timezone info, perfect for AI agents processing time-based data.

What's the difference between Unix seconds and milliseconds?

Unix timestamps are typically 10 digits (seconds since 1970) or 13 digits (milliseconds). The tool auto-detects format and converts appropriately.

Can I specify timezone when converting Unix timestamps?

Yes, pass timezone parameter to get results in specific zones like 'America/New_York' or 'Europe/London' instead of default UTC.

What datetime format does the Unix converter return?

Returns ISO 8601 format by default (YYYY-MM-DD HH:MM:SS TZ), but supports custom formatting patterns for different output requirements.

How do I handle invalid or future Unix timestamps?

The tool validates timestamp ranges and returns errors for invalid values. Future timestamps work fine, but check for reasonable date bounds in your application.

Try Unix To Datetime Now

Get your free API key and start using Unix To Datetime in seconds.

Get Free API Key