{"id":15404562,"url":"https://github.com/k1low/duration","last_synced_at":"2026-03-04T15:03:13.185Z","repository":{"id":43830063,"uuid":"208381094","full_name":"k1LoW/duration","owner":"k1LoW","description":"duration.Parse() parses a formatted string and returns the time.Duration value it represents.","archived":false,"fork":false,"pushed_at":"2022-09-23T07:20:16.000Z","size":18,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-07T05:07:01.345Z","etag":null,"topics":["duration","parser","time"],"latest_commit_sha":null,"homepage":"","language":"Go","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/k1LoW.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-09-14T03:03:35.000Z","updated_at":"2025-02-16T19:05:42.000Z","dependencies_parsed_at":"2022-09-05T02:51:15.530Z","dependency_job_id":null,"html_url":"https://github.com/k1LoW/duration","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/k1LoW/duration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fduration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fduration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fduration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fduration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/k1LoW","download_url":"https://codeload.github.com/k1LoW/duration/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/k1LoW%2Fduration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30084685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T13:22:36.021Z","status":"ssl_error","status_checked_at":"2026-03-04T13:20:45.750Z","response_time":59,"last_error":"SSL_read: 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":["duration","parser","time"],"created_at":"2024-10-01T16:13:42.694Z","updated_at":"2026-03-04T15:03:13.150Z","avatar_url":"https://github.com/k1LoW.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# duration [![Test](https://github.com/k1LoW/duration/actions/workflows/ci.yml/badge.svg)](https://github.com/k1LoW/duration/actions/workflows/ci.yml) [![GoDoc](https://godoc.org/github.com/k1LoW/duration?status.svg)](https://godoc.org/github.com/k1LoW/duration)\n\n`duration.Parse()` parses a formatted string and returns the time.Duration value it represents.\n\n## Usage\n\n``` go\npackage duration_test\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/k1LoW/duration\"\n)\n\nfunc ExampleParse() {\n\td, _ := duration.Parse(\"3 days 4 hours\")\n\tfmt.Printf(\"%s\", d)\n\t// Output: 76h0m0s\n}\n```\n\n## Supported unit of time\n\n| Unit of time | value |\n| --- | --- |\n| ns | time.Nanosecond |\n| nsec | time.Nanosecond |\n| nanosecond | time.Nanosecond |\n| nanoseconds | time.Nanosecond |\n| us | time.Microsecond |\n| usec | time.Microsecond |\n| microsecond | time.Microsecond |\n| microseconds | time.Microsecond |\n| ms | time.Millisecond |\n| msec | time.Millisecond |\n| millisecond | time.Millisecond |\n| milliseconds | time.Millisecond |\n| s | time.Second |\n| sec | time.Second |\n| second | time.Second |\n| seconds | time.Second |\n| m | time.Minute |\n| min | time.Minute |\n| minute | time.Minute |\n| minutes | time.Minute |\n| h | time.Hour |\n| hour | time.Hour |\n| hours | time.Hour |\n| d | time.Hour * 24 |\n| day | time.Hour * 24 |\n| days | time.Hour * 24 |\n| w | time.Hour * 24 * 7 |\n| week | time.Hour * 24 * 7 |\n| weeks | time.Hour * 24 * 7 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk1low%2Fduration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fk1low%2Fduration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fk1low%2Fduration/lists"}