Transform date strings into any format you need. Send a date and format pattern to GET /v1/datetime/format to get consistently formatted output. Perfect for standardizing timestamps in logs, APIs, or user interfaces. Uses standard format tokens like YYYY-MM-DD, ensuring your MCP-enabled AI tools handle dates correctly every time.
curl "https://tinyfn.io/v1/datetime/format" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/datetime/format', {
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/format',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
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"
}
}
}
}
Send your date string and desired format pattern to GET /v1/datetime/format. For example, format '2024-01-15' as 'MM/DD/YYYY' to get '01/15/2024'.
Standard tokens like YYYY (4-digit year), MM (2-digit month), DD (2-digit day), HH (24-hour), mm (minutes), ss (seconds). Combine with separators like /, -, or spaces.
Yes, it's available as an MCP tool in Cursor, Claude Code, GitHub Copilot, Windsurf, Cline, OpenClaw, and Zed for consistent date formatting in your AI workflows.
The tool returns an error response if the input date string cannot be parsed. Always validate your date inputs or handle potential parsing failures.
TinyFn provides deterministic, server-side formatting that's consistent across environments, while JavaScript methods can vary by browser locale and timezone settings.