# 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](/v1/tools/duration-parse-clock/versions/1.0.0) 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 20
- `standard_version` (constant "packet-r90-clock-1.0.0", required)

## Limits

- max input bytes: 34

## Example

Request input:

```json
{
  "clock": "01:01:01.250"
}
```

Response:

```json
{
  "result": {
    "seconds": "3661.250",
    "standard_version": "packet-r90-clock-1.0.0"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "duration-parse-clock",
  "version": "1.0.0",
  "input": {
    "clock": "01:01:01.250"
  }
}
```

### HTTP (no key)

```sh
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](/v1/tools/duration-parse-clock/versions/1.0.0).

### CLI

```sh
node cli.mjs run duration-parse-clock 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Duration format clock](/tools/duration-format-clock): Format a nonnegative whole or decimal second count as an exact hh:mm:ss[.fraction] clock duration.
- [ISO to epoch](/tools/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](/tools/iso-duration-structure-check): Check a claimed reading of an ISO 8601 duration: well-formedness, components and month/day/time totals.
- [Working hours total](/tools/working-hours-total): Total exact elapsed seconds in a versioned working-hours calendar after DST and closure expansion.
- [Duration convert](/tools/duration-convert): Convert a canonical integer duration between nanosecond-based SI units as an exact rational.
- [Duration application check](/tools/duration-application-check): Check a claimed timestamp from adding or subtracting an ISO 8601 duration under explicit offset and month-end rules.
