{"id":15893735,"url":"https://github.com/chinanf-boy/what-time","last_synced_at":"2025-04-02T18:15:57.684Z","repository":{"id":57397691,"uuid":"135664892","full_name":"chinanf-boy/what-time","owner":"chinanf-boy","description":"human readable time  seconds  人类可读时间 秒为单位","archived":false,"fork":false,"pushed_at":"2018-06-05T00:54:09.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T14:03:57.129Z","etag":null,"topics":["readable","time"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/chinanf-boy.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":"2018-06-01T03:50:35.000Z","updated_at":"2019-05-14T08:24:18.000Z","dependencies_parsed_at":"2022-08-30T13:30:19.800Z","dependency_job_id":null,"html_url":"https://github.com/chinanf-boy/what-time","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fwhat-time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fwhat-time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fwhat-time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Fwhat-time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinanf-boy","download_url":"https://codeload.github.com/chinanf-boy/what-time/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246866100,"owners_count":20846496,"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","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":["readable","time"],"created_at":"2024-10-06T08:13:07.066Z","updated_at":"2025-04-02T18:15:57.647Z","avatar_url":"https://github.com/chinanf-boy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# what-time [![Build Status](https://travis-ci.org/chinanf-boy/what-time.svg?branch=master)](https://travis-ci.org/chinanf-boy/what-time) [![codecov](https://codecov.io/gh/chinanf-boy/what-time/badge.svg?branch=master)](https://codecov.io/gh/chinanf-boy/what-time?branch=master)\n\n\u003e human readable time,  inspire from https://github.com/bahamas10/human/blob/master/human.js\n\n\n## Install\n\n\n\n```\nnpm install what-time\n```\n\n```\nyarn add what-time\n```\n\n\n\u003e ⚠️\n\n``` js\nconst whatTime = require('what-time');\n\nlet s = Date.now() // the number is miniseconds\n// something run\nlet e = Date.now()\n\nconsole.log(whatTime((s-e) / 1000) // whatTime is seconds , pleace  /1000\n\n```\n\n## Usage\n\n```js\nconst whatTime = require('what-time');\n\nwhatTime(1810.999)\n\n// \"30m 10s 999ms \"\n\nwhatTime(1810.999,true)\n\n//  \"30m 10s 999ms ago\"\n\n\nwhatTime(1527824212)\n//\"48Y 5M 1W 6d 3h 36m 52s \"\n\n\nwhatTime(1527824212,true)\n//\"48Y 5M 1W 6d 3h 36m 52s ago\"\n\n\nwhatTime(new Date(0))\n\n// now() -  Thu Jan 01 1970 08:00:00 GMT+0800 (CST)\n\n```\n\n\n## API\n\n### whatTime(timeNum, isSuffix)\n\n#### timeNum\n\nname: | timeNum\n---------|----------\nType: | `number\\|Date`\nDesc: | time number like Date.now().\n\n#### isSuffix\n\n name: | isSuffix\n---------|----------\nType: | `boolean`\nDefault: | `false`\nDesc: | Is add the `ago`/`from now`\n\n## contact\n\n- [reverse-what-time](https://github.com/chinanf-boy/reverse-what-time) reverse human time to number\n\n\n## use by\n\n- [node-modules-size](https://github.com/chinanf-boy/node-modules-size) get all node_modules size\n\n\n## License\n\nMIT © [chinanf-boy](http://llever.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fwhat-time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinanf-boy%2Fwhat-time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Fwhat-time/lists"}