Date/Time Utilities

Get Now

Returns the current UTC timestamp in ISO 8601 format. Access via MCP in Cursor or other AI editors, or call GET /v1/datetime/now directly. Perfect for logging, scheduling, or when AI agents need precise timing data. Always returns deterministic UTC time, eliminating timezone confusion in automated workflows.

API Endpoint

GET /v1/datetime/now

Code Examples

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

What format does the current time endpoint return?

Returns ISO 8601 UTC format like '2024-01-15T14:30:45.123Z'. This standardized format works across all programming languages and systems.

How do I get current time in my MCP-enabled editor?

Just ask your AI assistant for the current time. The MCP tool automatically calls the endpoint and returns the precise UTC timestamp.

Why does this always return UTC instead of local time?

UTC eliminates timezone ambiguity in distributed systems. Convert to local time in your application using the returned UTC timestamp as the source of truth.

Can I use this for high-frequency timestamp generation?

Yes, but each call returns the exact moment it's executed. For microsecond precision or batch operations, consider caching or generating multiple timestamps locally.

How does this compare to JavaScript's Date.now() or Python's datetime.now()?

This provides server-side UTC time that's consistent across clients, while local functions return the client's system time which may be incorrect or in different timezones.

Try Get Now Now

Get your free API key and start using Get Now in seconds.

Get Free API Key