{"id":13412433,"url":"https://github.com/goschtalt/approx","last_synced_at":"2026-04-04T12:16:26.103Z","repository":{"id":174842780,"uuid":"652856224","full_name":"goschtalt/approx","owner":"goschtalt","description":"Package approx adds support for durations of days, weeks and years.","archived":false,"fork":false,"pushed_at":"2024-10-21T18:48:24.000Z","size":132,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-22T11:06:22.070Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goschtalt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2023-06-12T23:55:19.000Z","updated_at":"2024-10-21T18:48:27.000Z","dependencies_parsed_at":"2024-01-05T02:41:55.343Z","dependency_job_id":"b77573f1-60b9-4cf2-9530-7780e6aa71af","html_url":"https://github.com/goschtalt/approx","commit_stats":null,"previous_names":["goschtalt/approx"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goschtalt%2Fapprox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goschtalt%2Fapprox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goschtalt%2Fapprox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goschtalt%2Fapprox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goschtalt","download_url":"https://codeload.github.com/goschtalt/approx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221495294,"owners_count":16832455,"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":[],"created_at":"2024-07-30T20:01:24.603Z","updated_at":"2026-04-04T12:16:25.520Z","avatar_url":"https://github.com/goschtalt.png","language":"Go","funding_links":[],"categories":["日期和时间","Date and Time"],"sub_categories":["检索及分析资料库","Search and Analytic Databases"],"readme":"# approx\n\n[![Build Status](https://github.com/goschtalt/approx/actions/workflows/ci.yml/badge.svg)](https://github.com/goschtalt/approx/actions/workflows/ci.yml)\n[![codecov.io](http://codecov.io/github/goschtalt/approx/coverage.svg?branch=main)](http://codecov.io/github/goschtalt/approx?branch=main)\n[![Go Report Card](https://goreportcard.com/badge/github.com/goschtalt/approx)](https://goreportcard.com/report/github.com/goschtalt/approx)\n[![GitHub Release](https://img.shields.io/github/release/goschtalt/approx.svg)](https://github.com/goschtalt/approx/releases)\n[![GoDoc](https://pkg.go.dev/badge/github.com/goschtalt/approx)](https://pkg.go.dev/github.com/goschtalt/approx)\n\nPackage approx adds support for durations of days, weeks and years.  The code\nused is from the go standard library.  Only very minor adjustments were made\nto enable parsing to support extra units of time.\n\n# Usage\n\nThis really simple library allows you to normally use the `time.Duration` object\nfrom the go standard library, but suppliments two functions for handling\napproximate time durations.\n\n```golang\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/goschtalt/approx\"\n)\n\nfunc main() {\n\td, err := approx.ParseDuration(\"1w4d\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(approx.String(d))\n\tfmt.Println(d)\n}\n```\n\n[Go Playground](https://go.dev/play/p/zX2FeTrC8Qb)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoschtalt%2Fapprox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoschtalt%2Fapprox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoschtalt%2Fapprox/lists"}