Duration parse clock
duration-parse-clock · version 1.0.0 · Dates & times (UTC, ISO 8601) · free, no key needed
Parse an hh:mm:ss[.fraction] duration and return the exact nonnegative whole or decimal second count.
Use when you need to: clock duration to seconds · parse hh:mm:ss · turn elapsed time into decimal seconds.
Decide before calling
Read the versioned contract and the supported scope below. Reuse duration-parse-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-parse-clock@1.0.0 for clock duration to 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
- clock duration to seconds
- parse hh:mm:ss
- turn elapsed time into decimal seconds
- convert time string to seconds
- read precise clock duration
- hours minutes seconds to total seconds
Not supported
- calendar times with time zones
- negative durations
- minutes or seconds above 59
Behavior
- Accept exactly two to six hour digits, two minute digits and two second digits, plus up to nine fractional digits.
- Minutes and seconds range from 00 through 59; hours are nonnegative and may exceed 23.
- Return canonical decimal seconds without leading zeroes while preserving supplied fractional digits.
Input
clock(string, required): min length 8; max length 22; pattern^[0-9]{2,6}:[0-5][0-9]:[0-5][0-9](\.[0-9]{1,9})?$
Output
seconds(string, required): min length 1; max length 20standard_version(constant "packet-r90-clock-1.0.0", required)
Limits
- max input bytes: 34
Example
Request input:
{
"clock": "01:01:01.250"
}
Response:
{
"result": {
"seconds": "3661.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-parse-clock",
"version": "1.0.0",
"input": {
"clock": "01:01:01.250"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/duration-parse-clock/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"clock":"01:01:01.250"}'
The machine-readable contract is at /v1/tools/duration-parse-clock/versions/1.0.0.
CLI
node cli.mjs run duration-parse-clock 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Duration format clock: Format a nonnegative whole or decimal second count as an exact hh:mm:ss[.fraction] clock duration.
- ISO to epoch: Convert a canonical RFC 3339 UTC timestamp to an exact integer Unix epoch count in the requested unit.
- ISO duration structure check: Check a claimed reading of an ISO 8601 duration: well-formedness, components and month/day/time totals.
- Working hours total: Total exact elapsed seconds in a versioned working-hours calendar after DST and closure expansion.
- Duration convert: Convert a canonical integer duration between nanosecond-based SI units as an exact rational.
- Duration application check: Check a claimed timestamp from adding or subtracting an ISO 8601 duration under explicit offset and month-end rules.