Date/Time Utilities

Convert Timestamp

Converts Unix timestamps to human-readable dates with precision control and timezone support. Use via MCP in Cursor or Windsurf for instant timestamp debugging, or call GET /v1/datetime/timestamp with your Unix value. Handles both seconds and milliseconds automatically — 1640995200 becomes "2022-01-01 00:00:00 UTC". Essential for log analysis and API debugging.

API Endpoint

GET /v1/datetime/timestamp

Code Examples

curl "https://tinyfn.io/v1/datetime/timestamp" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/datetime/timestamp', {
  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/timestamp',
    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 date/time tools:

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

Learn more about MCP setup →

FAQ

How do I convert a Unix timestamp to readable date format?

Call GET /v1/datetime/timestamp?timestamp=1640995200 or use the MCP tool in your AI editor. Returns ISO format and human-readable strings with timezone info.

Does it handle millisecond timestamps automatically?

Yes, it detects timestamp format automatically. Both 1640995200 (seconds) and 1640995200000 (milliseconds) work correctly without manual conversion.

Can I specify a different timezone for the output?

The tool supports timezone conversion parameters. Pass timezone codes like 'America/New_York' or 'Europe/London' to get localized output.

What's the easiest way to debug API timestamps in Cursor?

Enable the TinyFn MCP server in Cursor, then ask Claude to convert any timestamp you're debugging. No need to leave your editor or use external tools.

What happens with invalid or out-of-range timestamps?

Returns clear error messages for invalid inputs. Supports reasonable date ranges from 1970 to 2038 for 32-bit timestamps, extended ranges for 64-bit.

Try Convert Timestamp Now

Get your free API key and start using Convert Timestamp in seconds.

Get Free API Key