{"id":32171053,"url":"https://github.com/brianbolnick/humanize_time","last_synced_at":"2026-02-18T21:02:40.980Z","repository":{"id":57505960,"uuid":"217723961","full_name":"brianbolnick/humanize_time","owner":"brianbolnick","description":"Hex package for converting time durations to a more human readable format.","archived":false,"fork":false,"pushed_at":"2019-10-29T20:06:48.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T04:45:01.215Z","etag":null,"topics":["elixir","humanize","time"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/brianbolnick.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-26T14:51:44.000Z","updated_at":"2019-10-29T20:06:50.000Z","dependencies_parsed_at":"2022-09-26T17:51:50.157Z","dependency_job_id":null,"html_url":"https://github.com/brianbolnick/humanize_time","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brianbolnick/humanize_time","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianbolnick%2Fhumanize_time","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianbolnick%2Fhumanize_time/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianbolnick%2Fhumanize_time/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianbolnick%2Fhumanize_time/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianbolnick","download_url":"https://codeload.github.com/brianbolnick/humanize_time/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianbolnick%2Fhumanize_time/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["elixir","humanize","time"],"created_at":"2025-10-21T17:40:23.553Z","updated_at":"2026-02-18T21:02:40.975Z","avatar_url":"https://github.com/brianbolnick.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HumanizeTime\n\n## Description\nHumanizeTime is an Elixir library for converting seconds and milliseconds into more human readable strings. It allows for custom formatting and flexibility.  \n\n[Hex Docs](https://hexdocs.pm/humanize_time)\n\n## Installation\n\nThis package can be installed by adding `humanize_time` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:humanize_time, \"~\u003e 1.0\"}\n  ]\nend\n```\n\n## Example Usage\nCurrently, all formats are fixed and will show a maximum of 2 time periods.\n\n```elixir\n\u003e HumanizeTime.format_seconds(3600)\n# \"1 hr\"\n\n\u003e HumanizeTime.format_seconds(23487)\n# \"6 hr 31 min\"\n```\n\n## Custom Formatter\n`format_seconds` takes an optional keyword list of options.\n\n**:formatters** \n\nAllows for custom formatting of the result string. Value must be a map containing `days`, `hours`, `minutes`, and/or `seconds` as keys, with an anonymous function as value.\nDefault values will replace missing or incorrect keys.\n\nExample:\n```elixir\nopts = [\n  formatters: %{\n    days: fn day_val -\u003e \"#{day_value} D\",\n    hours: fn hour_val -\u003e \"#{hour_value} H\",\n    minutes: fn min_val -\u003e \"#{min_value} M\",\n    seconds: \u0026(\"#{\u00261} S\"),\n  }\n]\n\n\u003e HumanizeTime.format_seconds(23487, opts)\n# 6 M 31 M\n```\n\n**:nil_fallback**\n\nIf input is nil, `nil_fallback` allows you to set a default/fallback value. \n\nExample:\n```elixir\nopts = [\n\tnil_fallback: \"No current data.\n]\n\n\u003e HumanizeTime.format_seconds(nil, opts)\n\n# No current data.\n```\n\n## Contributing\nContributions are welcome! Submit a pull request if you would like to contribute.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianbolnick%2Fhumanize_time","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianbolnick%2Fhumanize_time","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianbolnick%2Fhumanize_time/lists"}