Converts human-readable datetime strings to Unix timestamps (seconds since January 1, 1970 UTC). Access via MCP in Cursor or Windsurf, or REST at `/v1/time/datetime-to-unix`. Pass "2024-03-15 14:30:00" and get back 1710509400. Handles ISO 8601 formats and timezone conversions accurately.
curl "https://tinyfn.io/v1/time/datetime-to-unix" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/time/datetime-to-unix', {
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/datetime-to-unix',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
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"
}
}
}
}
Supports ISO 8601 formats like '2024-03-15T14:30:00Z', '2024-03-15 14:30:00', and variations with timezone offsets (+05:00, -08:00).
Call the datetime-to-unix tool with your datetime string as the parameter. The MCP integration handles the conversion and returns the numeric timestamp.
Yes, it processes timezone information in the input string. If no timezone is specified, it assumes UTC by default.
They're the same thing — both represent seconds elapsed since January 1, 1970, 00:00:00 UTC (the Unix epoch).
Works for any valid date, past or future. Unix timestamps can represent dates well into the future (until 2038 for 32-bit systems, much longer for 64-bit).
Get your free API key and start using Datetime To Unix in seconds.
Get Free API Key