Converts raw seconds into readable hours:minutes:seconds format. Use via MCP in Cursor or REST API at /v1/convert/time/seconds-to-hms. Pass 3661 seconds, get "1:01:01" back. Perfect for AI agents processing timestamps, durations, or media files without floating-point rounding errors.
curl "https://tinyfn.io/v1/convert/time/seconds-to-hms" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/convert/time/seconds-to-hms', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/convert/time/seconds-to-hms',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's conversion tools:
{
"mcpServers": {
"tinyfn-conversion": {
"url": "https://tinyfn.io/mcp/conversion",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Send seconds as a parameter to GET /v1/convert/time/seconds-to-hms. Returns H:MM:SS format like "2:30:45" for 9045 seconds.
Returns H:MM:SS or HH:MM:SS format. Minutes and seconds are zero-padded to 2 digits, hours show actual value without padding.
Yes, handles any positive integer. 86400 seconds becomes "24:00:00", 3661 becomes "1:01:01". No upper limit on hours.
Designed for whole seconds only. Decimals are typically truncated or rounded depending on implementation.
Provides consistent formatting and handles edge cases deterministically. Eliminates common bugs with modulo operations and zero-padding.
Get your free API key and start using Seconds To Hms in seconds.
Get Free API Key