Duration format clock
duration-format-clock · version 1.0.0 · Dates & times (UTC, ISO 8601) · free, no key needed
Format a nonnegative whole or decimal second count as an exact hh:mm:ss[.fraction] clock duration.
Use when you need to: seconds to hours minutes seconds · format duration as hh:mm:ss · turn decimal seconds into clock time.
Decide before calling
Read the versioned contract and the supported scope below. Reuse duration-format-clock@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use duration-format-clock@1.0.0 for seconds to hours minutes seconds. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- seconds to hours minutes seconds
- format duration as hh:mm:ss
- turn decimal seconds into clock time
- display elapsed seconds as a clock
- seconds to time string
- format precise duration
Not supported
- calendar dates
- negative durations
- rounding fractional seconds
Behavior
- Accept nonnegative canonical decimal seconds with at most nine fractional digits.
- Hours may exceed 23 and are padded to at least two digits; minutes and seconds are always two digits.
- Preserve the supplied fractional digits exactly; do not round or use binary floating point.
Input
seconds(string, required): min length 1; max length 20; pattern^(0|[1-9][0-9]{0,9})(\.[0-9]{1,9})?$
Output
clock(string, required): min length 8; max length 22standard_version(constant "packet-r90-clock-1.0.0", required)
Limits
- max input bytes: 34
Example
Request input:
{
"seconds": "3661.250"
}
Response:
{
"result": {
"clock": "01:01:01.250",
"standard_version": "packet-r90-clock-1.0.0"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "duration-format-clock",
"version": "1.0.0",
"input": {
"seconds": "3661.250"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/duration-format-clock/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"seconds":"3661.250"}'
The machine-readable contract is at /v1/tools/duration-format-clock/versions/1.0.0.
CLI
node cli.mjs run duration-format-clock 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Duration parse clock: Parse an hh:mm:ss[.fraction] duration and return the exact nonnegative whole or decimal second count.
- ISO duration structure check: Check a claimed reading of an ISO 8601 duration: well-formedness, components and month/day/time totals.
- ISO to epoch: Convert a canonical RFC 3339 UTC timestamp to an exact integer Unix epoch count in the requested unit.
- Working hours total: Total exact elapsed seconds in a versioned working-hours calendar after DST and closure expansion.
- Duration application check: Check a claimed timestamp from adding or subtracting an ISO 8601 duration under explicit offset and month-end rules.
- Duration convert: Convert a canonical integer duration between nanosecond-based SI units as an exact rational.