{"id":16483525,"url":"https://github.com/trevorblades/clock-time","last_synced_at":"2025-08-12T12:33:27.259Z","repository":{"id":46949045,"uuid":"97540158","full_name":"trevorblades/clock-time","owner":"trevorblades","description":"⏱ Formats milliseconds or minutes and seconds as clock time","archived":false,"fork":false,"pushed_at":"2023-03-01T09:48:10.000Z","size":1644,"stargazers_count":10,"open_issues_count":14,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-31T18:56:07.500Z","etag":null,"topics":["clock","format","milliseconds","minutes","seconds","time"],"latest_commit_sha":null,"homepage":"https://npm.im/clock-time","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trevorblades.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-18T01:50:56.000Z","updated_at":"2024-06-30T06:00:59.000Z","dependencies_parsed_at":"2023-02-01T06:45:40.979Z","dependency_job_id":null,"html_url":"https://github.com/trevorblades/clock-time","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/trevorblades/clock-time","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevorblades%2Fclock-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevorblades%2Fclock-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevorblades%2Fclock-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevorblades%2Fclock-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trevorblades","download_url":"https://codeload.github.com/trevorblades/clock-time/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trevorblades%2Fclock-time/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270061164,"owners_count":24520253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clock","format","milliseconds","minutes","seconds","time"],"created_at":"2024-10-11T13:14:19.087Z","updated_at":"2025-08-12T12:33:27.237Z","avatar_url":"https://github.com/trevorblades.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clock Time\n\n[![Build Status](https://github.com/trevorblades/clock-time/workflows/Node%20CI/badge.svg)](https://github.com/trevorblades/clock-time/actions)\n\nFormats milliseconds or minutes and seconds as clock time\n\n## Installation\n\n```shell\nnpm install clock-time\n```\n\n## Usage\n\nImport or `require` the package and pass milliseconds as a single argument to get nicely formatted clock time.\n\n```js\nimport clockTime from 'clock-time'; // es6\nconst clockTime = require('clock-time'); // cjs\n\nclockTime(60 * 1000); // 1:00\n```\n\nOr, pass the number of minutes as the first argument and the number of seconds as the second argument instead.\n\n```js\nclockTime(4, 20); // 4:20\n```\n\n### `toClockParts`\n\nUse the named export `toClockParts` to convert milliseconds to an object of minutes, zero-padded seconds, and total seconds. This can be useful when you want to use the parts of a clock time separately or in addition to the formatted string.\n\nIf the second argument to `toClockParts` is `true`, zero-padding on the returned `seconds` property will be disabled and `seconds` will be a number.\n\n```js\nimport {toClockParts} from 'clock-time';\n\nconst {\n  minutes, // 4\n  seconds, // 20\n  total // 260\n} = toClockParts(260000);\n\nconst formatted = `${minutes}:${seconds}`; // or clockTime(minutes, seconds)\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrevorblades%2Fclock-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrevorblades%2Fclock-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrevorblades%2Fclock-time/lists"}