{"id":15383905,"url":"https://github.com/heruan/humanize","last_synced_at":"2025-04-15T19:38:26.831Z","repository":{"id":57743291,"uuid":"98511279","full_name":"heruan/humanize","owner":"heruan","description":"Humanization libraries for Java.","archived":false,"fork":false,"pushed_at":"2020-10-13T01:35:28.000Z","size":27,"stargazers_count":4,"open_issues_count":3,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-07T11:11:52.847Z","etag":null,"topics":["i18n","java","time"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heruan.png","metadata":{"files":{"readme":"README.adoc","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-27T08:16:03.000Z","updated_at":"2022-06-01T14:02:48.000Z","dependencies_parsed_at":"2022-09-12T10:11:25.683Z","dependency_job_id":null,"html_url":"https://github.com/heruan/humanize","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heruan%2Fhumanize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heruan%2Fhumanize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heruan%2Fhumanize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heruan%2Fhumanize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heruan","download_url":"https://codeload.github.com/heruan/humanize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240331362,"owners_count":19784646,"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":["i18n","java","time"],"created_at":"2024-10-01T14:39:56.306Z","updated_at":"2025-02-28T09:31:44.499Z","avatar_url":"https://github.com/heruan.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Humanization libraries for Java\n\nimage:https://img.shields.io/github/release/heruan/humanize.svg[link=https://github.com/heruan/humanize/releases,title=Latest release]\nimage:https://img.shields.io/github/downloads/heruan/humanize/total.svg[link=https://github.com/heruan/humanize/archive/master.zip,title=GitHub]\nimage:https://img.shields.io/circleci/project/github/heruan/humanize.svg[link=https://circleci.com/gh/heruan/humanize,title=CricleCI]\nimage:https://img.shields.io/codecov/c/github/heruan/humanize.svg[link=https://codecov.io/gh/heruan/humanize,title=Codecov]\nimage:https://img.shields.io/github/license/heruan/humanize.svg[link=http://www.apache.org/licenses/LICENSE-2.0.html,title=Apache License 2.0]\n\n== humanize-time\n\nimage:https://img.shields.io/maven-central/v/to.lova.humanize/humanize-time.svg[title=humanize-time]\n\nAdd the dependency to your `pom.xml`:\n\n[source,xml]\n----\n\u003cdependency\u003e\n    \u003cgroupId\u003eto.lova.humanize\u003c/groupId\u003e\n    \u003cartifactId\u003ehumanize-time\u003c/artifactId\u003e\n    \u003cversion\u003e0.1.2\u003c/version\u003e\n\u003c/dependency\u003e\n----\n\nUse it in your code as simple as:\n\n[source,java]\n----\nTemporal minutesAgo = ZonedDateTime.now().minus(5, ChronoUnit.MINUTES);\nString relative = HumanizeTime.fromNow(minutesAgo);\n// produces: \"5 minutes ago\"\n----\n\nBy default it uses the locale provided by `Locale.getDefault()`, but you can request a different one or provide your own resolver:\n\n[source,java]\n----\nTemporal minutesAgo = ZonedDateTime.now().minus(5, ChronoUnit.MINUTES);\nLocale.setDefault(Locale.ITALIAN);\nString italian = HumanizeTime.fromNow(temporal);\n// produces: \"5 minuti fa\"\nString french = HumanizeTime.fromNow(temporal, Locale.FRENCH);\n// produces: \"il y a 5 minutes\"\nString japanese = HumanizeTime.fromNow(temporal, () -\u003e Locale.JAPANESE);\n// produces: \"5時間前\"\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheruan%2Fhumanize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheruan%2Fhumanize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheruan%2Fhumanize/lists"}