{"id":13412457,"url":"https://github.com/ijt/go-anytime","last_synced_at":"2026-04-10T10:32:41.894Z","repository":{"id":61253461,"uuid":"547028848","full_name":"ijt/go-anytime","owner":"ijt","description":"Parse natural and standardized dates/times and ranges in Go without knowing the format in advance","archived":false,"fork":false,"pushed_at":"2023-01-17T22:00:00.000Z","size":586,"stargazers_count":20,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-31T20:50:56.585Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ijt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"ijt"}},"created_at":"2022-10-07T03:02:09.000Z","updated_at":"2024-06-04T12:56:44.000Z","dependencies_parsed_at":"2023-02-10T12:16:50.775Z","dependency_job_id":null,"html_url":"https://github.com/ijt/go-anytime","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/ijt/go-anytime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijt%2Fgo-anytime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijt%2Fgo-anytime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijt%2Fgo-anytime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijt%2Fgo-anytime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ijt","download_url":"https://codeload.github.com/ijt/go-anytime/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijt%2Fgo-anytime/sbom","scorecard":{"id":483475,"data":{"date":"2025-08-11","repo":{"name":"github.com/ijt/go-anytime","commit":"3183858dfff2a929e53faad28f0b705586527da3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/7 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/ijt/go-anytime/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/ijt/go-anytime/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/ijt/go-anytime/test.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: GoBuiltInFuzzer integration found: v2/replace_test.go:533","Info: GoBuiltInFuzzer integration found: v2/replace_test.go:548"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T17:12:32.076Z","repository_id":61253461,"created_at":"2025-08-19T17:12:32.076Z","updated_at":"2025-08-19T17:12:32.076Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31638472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"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":[],"created_at":"2024-07-30T20:01:24.889Z","updated_at":"2026-04-10T10:32:41.873Z","avatar_url":"https://github.com/ijt.png","language":"Go","funding_links":["https://github.com/sponsors/ijt"],"categories":["Date and Time","日期和时间"],"sub_categories":["Search and Analytic Databases","检索及分析资料库"],"readme":"# Go Anytime\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/ijt/go-anytime)](https://goreportcard.com/report/github.com/ijt/go-anytime)\n[![codecov](https://codecov.io/gh/ijt/go-anytime/branch/main/graph/badge.svg?token=GA1TIU7OHK)](https://codecov.io/gh/ijt/go-anytime)\n[![GoDoc](https://godoc.org/github.com/ijt/go-anytime?status.svg)](https://godoc.org/github.com/ijt/go-anytime)\n![](https://img.shields.io/badge/license-MIT-blue.svg)\n[![Awesome](https://cdn.rawgit.com/avelino/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/avelino/awesome-go#date-and-time)\n\nNatural date time parsing for Go. This package was originally forked from\n[github.com/tj/go-naturaldate](https://github.com/tj/go-naturaldate) but has diverged so much that it needed a new name\nto avoid confusion. Here are the largest differences:\n\n1. The `go-anytime` module is written in terms of the [github.com/ijt/goparsify](https://github.com/ijt/goparsify) parser combinator module, rather than the [github.com/pointlander/peg](https://github.com/pointlander/peg) parsing module. That made its development and debugging easier, and also means that its parsers can be use within other parsers that use `ijt/goparsify`.\n2. Ranges can be parsed using `ParseRange` or `RangeParser`, for example `\"from 3 feb 2022 until 6 oct 2022\"`.\n3. Dates/times and ranges can be replaced in strings using the funcs `ReplaceTimesByFunc`, `ReplaceRangesByFunc`, and `ReplaceDateRangesByFunc`.\n4. Strings can be partitioned into time and non-time parts using the funcs `PartitionTimes` and `PartitionTimesByFuncs`.\n\n## Examples\n\nHere are some examples of expressions that can be parsed by `anytime.Parse()` or `anytime.Parser`:\n\n- now\n- today\n- yesterday\n- 5 minutes ago\n- three days ago\n- last month\n- next month\n- one year from now\n- yesterday at 10am\n- last sunday at 5:30pm\n- next sunday at 22:45\n- next January\n- last February\n- next December 25th at 7:30am\n- next December 25th at 7:30am UTC-7\n- November 3rd, 1986 at 4:30pm\n- january 2017\n- january, 2017\n- oct 7, 1970\n- oct 7 1970\n- 7 oct 1970\n- 7 oct, 1970\n- September 17, 2012 UTC+7\n- September 17, 2012\n- 03 February 2013\n- 2 July 2013\n- 2014/3/31\n- 2014/3/31 UTC\n- 2014/3/31 UTC+1\n- 2014/03/31\n- 2014/03/31 UTC-1\n- 2014-04-26\n- 2014-4-26\n- 2014-4-6\n- 31/3/2014 UTC-8\n- 31-3-2014 UTC-8\n- 31/3/2014\n- 31-3-2014\n- January\n- december 20\n- thursday at 23:59\n- See the [tests](./anytime_test.go) for more examples\n\n## Range examples\n\nHere are some examples of expressions that can be parsed by `anytime.ParseRange()` or `anytime.RangeParser`:\n\n- from 3 feb 2022 to 6 oct 2022\n- 3 feb 2022 to 6 oct 2022\n- from 3 feb 2022 until 6 oct 2022\n- from tuesday at 5pm -12:00 until thursday 23:52 +14:00\n- last year\n- today\n- next week\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijt%2Fgo-anytime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fijt%2Fgo-anytime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijt%2Fgo-anytime/lists"}