Calculates the exact start of any time period (day, week, month, year, etc.) from a given timestamp. Access via MCP in Cursor or Windsurf, or REST at GET /v1/time/start-of. Perfect for AI agents building scheduling logic or analytics that need precise period boundaries. Returns ISO timestamps with millisecond accuracy.
curl "https://tinyfn.io/v1/time/start-of" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/time/start-of', {
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/start-of',
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"
}
}
}
}
Pass the current timestamp with period='week' parameter. Returns Monday 00:00:00 in the specified timezone (defaults to UTC).
Supports day, week, month, quarter, year, hour, and minute periods. Week starts are configurable (Monday vs Sunday).
Yes, set period='quarter' to get Q1 (Jan 1), Q2 (Apr 1), Q3 (Jul 1), or Q4 (Oct 1) start dates. Handles fiscal year offsets too.
Yes, specify timezone parameter (e.g., 'America/New_York'). Period boundaries adjust to local time, not just UTC offsets.
Start-of-day respects timezone rules including DST transitions, while simple truncation can miss hour shifts during clock changes.
Get your free API key and start using Start Of Period in seconds.
Get Free API Key