Converts human-readable dates into Unix timestamps for system integration and data processing. Use via MCP in Cursor or Windsurf, or call GET /v1/datetime/to-timestamp directly. Example: "2024-03-15 14:30:00" becomes 1710511800. Returns precise epoch seconds, handling timezone conversions and multiple date formats deterministically.
curl "https://tinyfn.io/v1/datetime/to-timestamp" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/datetime/to-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/to-timestamp',
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"
}
}
}
}
Accepts ISO 8601, RFC 3339, and common formats like YYYY-MM-DD HH:MM:SS. Also handles partial dates, automatically filling missing time components with zeros.
In Cursor or Claude Code, reference the date-to-timestamp tool with your date string. The AI agent will call the MCP function and return the Unix timestamp immediately.
Yes, it processes timezone indicators in the input date. If no timezone is specified, it defaults to UTC to ensure consistent, deterministic results across systems.
This tool returns Unix timestamps in seconds (standard epoch format), while JavaScript returns milliseconds. It also handles edge cases and invalid dates more predictably.
Each API call processes one date. For batch operations, make multiple requests or use the MCP tool repeatedly within your AI workflow for efficient processing.
Get your free API key and start using Date To Timestamp in seconds.
Get Free API Key