{"id":16829174,"url":"https://github.com/montanaflynn/human-date","last_synced_at":"2025-08-31T04:06:28.835Z","repository":{"id":23265399,"uuid":"26623814","full_name":"montanaflynn/human-date","owner":"montanaflynn","description":"Making dates and times readable for humans.","archived":false,"fork":false,"pushed_at":"2024-04-21T14:57:14.000Z","size":67,"stargazers_count":44,"open_issues_count":3,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-16T19:47:53.551Z","etag":null,"topics":["dates","humanizer","javascript","library","pretty-print","time"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/montanaflynn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-14T05:30:14.000Z","updated_at":"2024-04-21T14:43:32.000Z","dependencies_parsed_at":"2024-06-18T15:37:46.133Z","dependency_job_id":"ace9532d-78f6-4ac1-81ec-9882e3431b89","html_url":"https://github.com/montanaflynn/human-date","commit_stats":{"total_commits":93,"total_committers":6,"mean_commits":15.5,"dds":0.06451612903225812,"last_synced_commit":"ee9d33a6eed92ef3524b18f82e66524dbb5d670d"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/montanaflynn/human-date","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montanaflynn%2Fhuman-date","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montanaflynn%2Fhuman-date/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montanaflynn%2Fhuman-date/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montanaflynn%2Fhuman-date/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/montanaflynn","download_url":"https://codeload.github.com/montanaflynn/human-date/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/montanaflynn%2Fhuman-date/sbom","scorecard":{"id":659056,"data":{"date":"2025-08-11","repo":{"name":"github.com/montanaflynn/human-date","commit":"4ce2a9ac85b92963c53d2f9f716828627e8e12b2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":1,"reason":"Found 4/25 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T15:32:39.550Z","repository_id":23265399,"created_at":"2025-08-21T15:32:39.550Z","updated_at":"2025-08-21T15:32:39.550Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272936419,"owners_count":25018160,"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-31T02:00:09.071Z","response_time":79,"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":["dates","humanizer","javascript","library","pretty-print","time"],"created_at":"2024-10-13T11:31:17.820Z","updated_at":"2025-08-31T04:06:28.763Z","avatar_url":"https://github.com/montanaflynn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# human-date [![NPM Version](http://img.shields.io/npm/v/human-date.svg)](https://www.npmjs.org/package/human-date) [![wercker continuous integration testing](http://img.shields.io/wercker/ci/546b83aba60c33c27c02add4.svg)](https://app.wercker.com/project/bykey/2a16934d4add8e3fc3fb7ab83c7cc866)\n\nMaking dates and times readable for humans.\n\n### Quick Start\n\n##### Install:\n\n```shell\nnpm install human-date --save\n```\n\n##### Usage:\n\n```js\nvar hdate = require('human-date')\n\nhdate.prettyPrint(\"8/16/1987\")\n// August 16th, 1987\n\nhdate.relativeTime(60 * 60 * 24 * 2 * -1)\n// 2 days ago\n\nhdate.relativeTime(\"8/16/2015\")\n// 125 days from now\n\nhdate.monthName(\"8/16/2015\")\n// August\n```\n\n### Methods\n\n#### .prettyPrint(datestring or jsdate or numseconds, [options])\n\n##### Arguments:\n\n- __datestring `string`__ that can be parsed as a date (Eg. `\"8/16/1987\"`)\n- __jsdate `object`__ which is a javascript Date (Eg. `new Date(\"8/16/1987\")`)\n- __numseconds `integer`__ seconds to or from the current time (Eg. `-32`)\n- __options__: object with the following keys\n    - __showTime `boolean`__: default: `false`\n    - __monthAbbreviated `boolean`__: default: `false`\n\n##### Returns:\n\n- __`string`__ representing the date. (Eg. `\"August 16th, 1987\"`)\n\n##### Examples:\n\n```js\nhdate.prettyPrint('8-16-1987')\n// August 16th, 1987\n\nhdate.prettyPrint(new Date('8-16-1987'))\n// August 16th, 1987\n\nhdate.prettyPrint(-6400)\n// November 17th, 2014 (at the time)\n\nhdate.prettyPrint(new Date(1416448704578), { showTime: true })\n// November 19th, 2014 at 5:58 pm\n\nhdate.prettyPrint('12-25-1980', { monthAbbreviated: true })\n// Dec 25th, 1980\n```\n\n#### .relativeTime(datestring or jsdate or numseconds, [options])\n\n##### Arguments:\n\n- __datestring `string`__ that can be parsed as a date (Eg. `\"8/16/1987\"`)\n- __jsdate `object`__ which is a javascript Date (Eg. `new Date(\"8/16/1987\")`)\n- __numseconds `integer`__ seconds to or from the current time (Eg. `-32`)\n- __options__: object with the following keys\n    - __futureSuffix `string`__ default: `\"from now\"`\n    - __pastSuffix `string`__ default: `\"from now\"`\n    - __presentText `string`__ default: `\"now\"`\n    - __returnObject `boolean`__: default: `false`\n    - __allUnits `boolean`__: default: `false`\n\n##### Returns:\n\nDepending on the option `returnObject` you will get a string or an object:\n\n- __default `string`__ `\"27 years 96 days 21 hours 47 minutes 2 seconds ago\"`\n- __`object`__ `{ seconds: 31, hours: 4, days: 101, years: 27, past: true }`\n\n##### Examples:\n\n```js\nhdate.relativeTime(4)\n// 4 seconds from now\n\nhdate.relativeTime(4, {futureSuffix: \"in the future\"})\n// 4 seconds in the future\n\nhdate.relativeTime(\"8-16-1987\")\n// 27 years ago\n\nhdate.relativeTime(new Date(\"8-16-1987\"))\n// 27 years ago\n\nhdate.relativeTime(new Date(\"8-16-1987\"), {returnObject: true})\n// { seconds: 31, minutes: 5, hours: 4, days: 101, years: 27, past: true }\n\nhdate.relativeTime(75, {allUnits: true})\n// 1 minute, 15 seconds from now\n```\n\n#### .monthName(datestring | jsdate | monthnum, monthAbbreviated)\n\n##### Arguments:\n\n- __datestring `string`__ that can be parsed as a date (Eg. `\"8/16/1987\"`)\n- __jsdate `object`__ which is a javascript Date (Eg. `new Date(\"8/16/1987\")`)\n- __monthnum `integer`__ the month number, not 0-indexed (Eg. `12`)\n\n- __monthAbbreviated `boolean`__ whether to abbreviate the month name (Eg. `Dec`)\n##### Returns:\n\n- __`string`__\n\n##### Examples:\n\n```js\nhdate.monthName(8)\n// August\n\nhdate.monthName(\"8-16-1987\")\n// August\n\nhdate.monthName(new Date(\"8-16-1987\"))\n// August\n\nhdate.monthName(new Date(\"8-16-1987\"), true)\n// Aug\n```\n\n#### .toUTC(datestring or jsdate or monthnum)\n\n##### Arguments:\n\n- __datestring `string`__ that can be parsed as a date (Eg. `\"8/16/1987\"`)\n- __jsdate `object`__ which is a javascript Date (Eg. `new Date(\"8/16/1987\")`)\n- __epochtime `integer`__ time since epoch, in milliseconds (Eg. `1416451096261`)\n\n##### Returns:\n\n- __`object`__ native Date object modified to UTC timezone.\n\n##### Examples:\n\n```js\nhdate.toUTC(1000000000000)\n// '2001-09-09T08:46:40.000Z'\n\nhdate.toUTC(1000000000000).getFullYear()\n// 2001\n\nhdate.toUTC(\"8-16-1987\")\n// Sun Aug 16 1987 07:00:00 GMT-0700 (PDT)\n\nhdate.toUTC(new Date(\"8-16-1987\"))\n// Sun Aug 16 1987 07:00:00 GMT-0700 (PDT)\n\nhdate.toUTC(new Date(\"8-16-1987\")).toISOString()\n// 1987-08-16T14:00:00.000Z\n```\n\n### Todos\n\n- Add various options (prefixes, etc...)\n- Support different locales.\n\n### Contributing\n\n__Forks and pull requests are most welcomed.__\n\nPlease add any methods to test.js and run `npm test` before sending a pull request.\n\n### MIT license\n\nCopyright (c) 2014-2016, Montana Flynn (http://anonfunction.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmontanaflynn%2Fhuman-date","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmontanaflynn%2Fhuman-date","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmontanaflynn%2Fhuman-date/lists"}