Extracts the fiscal quarter (1-4) from any date input. Call via MCP in Cursor or Windsurf, or hit GET /v1/time/quarter with your date. Returns clean integer output like `{"quarter": 2}` for April dates. Handles various date formats and timezone considerations automatically.
curl "https://tinyfn.io/v1/time/quarter" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/time/quarter', {
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/quarter',
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"
}
}
}
}
Accepts ISO 8601 (2024-04-15), Unix timestamps, and common formats like MM/DD/YYYY. Always assumes standard calendar quarters unless specified otherwise.
Call the quarter tool repeatedly in your MCP session, or batch process dates in your application code using the REST endpoint for better performance.
Returns standard calendar quarters by default: Q1 (Jan-Mar), Q2 (Apr-Jun), Q3 (Jul-Sep), Q4 (Oct-Dec). Fiscal year quarters require different calculation logic.
Handles leap years correctly and processes dates in UTC unless timezone is specified. Month boundaries determine quarter assignment regardless of specific day.
Yes, the clean integer output (1-4) integrates easily with spreadsheets, databases, and reporting tools. Combine with other time utilities for comprehensive date processing.