{"id":32167701,"url":"https://github.com/pr0grammr/time-ago","last_synced_at":"2026-02-20T16:01:26.365Z","repository":{"id":62430445,"uuid":"229486484","full_name":"pr0grammr/time-ago","owner":"pr0grammr","description":"🕐 Elixir module for calculating the range of two datetimes and get the days/hours/minutes/seconds","archived":false,"fork":false,"pushed_at":"2020-11-30T20:58:30.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T15:40:10.869Z","etag":null,"topics":["elixir","time","timeago"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/time_ago","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/pr0grammr.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":"2019-12-21T21:41:39.000Z","updated_at":"2020-11-30T20:58:32.000Z","dependencies_parsed_at":"2022-11-01T20:18:41.639Z","dependency_job_id":null,"html_url":"https://github.com/pr0grammr/time-ago","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pr0grammr/time-ago","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pr0grammr%2Ftime-ago","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pr0grammr%2Ftime-ago/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pr0grammr%2Ftime-ago/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pr0grammr%2Ftime-ago/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pr0grammr","download_url":"https://codeload.github.com/pr0grammr/time-ago/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pr0grammr%2Ftime-ago/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29656589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"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","time","timeago"],"created_at":"2025-10-21T15:35:33.174Z","updated_at":"2026-02-20T16:01:26.357Z","avatar_url":"https://github.com/pr0grammr.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TimeAgo\n\nModule for getting the amount of days/hours/minutes/seconds since past a specific date.\nThis module is inspired by the functionality of many social networks and forums\n\n![build \u0026 test](https://github.com/pr0grammr/time-ago/workflows/build%20\u0026%20test/badge.svg?branch=master)\n\u003ca href=\"https://hexdocs.pm/time_ago/TimeAgo.html#content\" target=\"_blank\"\u003e\u003cimg alt=\"Hex.pm\" src=\"https://img.shields.io/hexpm/dt/time_ago\"\u003e\u003c/a\u003e\n\u003ca href=\"https://hexdocs.pm/time_ago/TimeAgo.html#content\" target=\"_blank\"\u003e\u003cimg alt=\"Hex.pm\" src=\"https://img.shields.io/hexpm/v/time_ago\"\u003e\u003c/a\u003e\n\n## Installation\n\nThe package can be installed\nby adding `time_ago` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:time_ago, \"~\u003e 1.1.0\"}\n  ]\nend\n```\n\n## Usage\n\n```elixir\n# returns original date if amount of days are more than 7\niex\u003e TimeAgo.from_date ~N[2019-12-10 23:00:00], ~N[2019-12-21 22:30:00]\n{:date, ~N[2019-12-10 23:00:00]}\n\n# returns days if amount of days are more than 0\niex\u003e TimeAgo.from_date ~N[2019-12-18 12:00:00], ~N[2019-12-21 22:30:00]\n{:days, 3}\n\n# returns hours if amount of hours are more than 0\niex\u003e TimeAgo.from_date ~N[2019-12-21 20:00:00], ~N[2019-12-21 22:30:00]\n{:hours, 2}\n\n# returns minutes if amount of minutes are more than 0\niex\u003e TimeAgo.from_date ~N[2019-12-21 18:00:00], ~N[2019-12-21 18:30:00]\n{:minutes, 30}\n\n# returns seconds if amount of seconds are more than 0\niex\u003e TimeAgo.from_date ~N[2019-12-21 13:00:00], ~N[2019-12-21 13:00:55]\n{:seconds, 55}\n```\n\n## Pattern Matching\n\n```elixir\ncase TimeAgo.from_date ~N[2019-12-21 20:00:00], ~N[2019-12-21 22:30:00] do\n  {:days, days} -\u003e\n    IO.puts \"#{days} days ago\"\n  {:hours, hours} -\u003e\n    IO.puts \"#{hours} hours ago\"\n  {:minutes, minutes} -\u003e\n    IO.puts \"#{minutes} minutes ago\"\n  {:seconds, seconds} -\u003e\n    IO.puts \"#{seconds} seconds ago\"\nend\n\n# =\u003e 2 hours ago\n```\n\n## License \n\nThis module is published under the \u003ca href=\"https://github.com/pr0grammr/time-ago/blob/master/LICENSE\"\u003eMIT license\u003c/a\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpr0grammr%2Ftime-ago","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpr0grammr%2Ftime-ago","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpr0grammr%2Ftime-ago/lists"}