{"id":42950912,"url":"https://github.com/pnelson/when","last_synced_at":"2026-01-30T21:11:16.763Z","repository":{"id":57704485,"uuid":"497752465","full_name":"pnelson/when","owner":"pnelson","description":"Package when implements a natural language date/time arithmetic parser.","archived":false,"fork":false,"pushed_at":"2022-11-23T02:11:50.000Z","size":53,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T05:13:03.824Z","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":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pnelson.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":"2022-05-30T01:35:14.000Z","updated_at":"2023-04-07T08:02:51.000Z","dependencies_parsed_at":"2023-01-23T10:15:22.583Z","dependency_job_id":null,"html_url":"https://github.com/pnelson/when","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pnelson/when","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnelson%2Fwhen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnelson%2Fwhen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnelson%2Fwhen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnelson%2Fwhen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pnelson","download_url":"https://codeload.github.com/pnelson/when/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnelson%2Fwhen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28919470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T20:25:28.696Z","status":"ssl_error","status_checked_at":"2026-01-30T20:25:13.426Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2026-01-30T21:11:16.178Z","updated_at":"2026-01-30T21:11:16.758Z","avatar_url":"https://github.com/pnelson.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# when\n\nPackage when implements a natural language date/time arithmetic parser.\n\nParse a duration that resolves to a time in the future:\n\n```go\nt, err := when.Parse(\"6 hours\")\n```\n\nThis can be reversed:\n\n```go\nt, err := when.Parse(\"6 hours ago\")\n```\n\nDigits up to twelve can be spelled:\n\n```go\nt, err := when.Parse(\"six hours ago\")\n```\n\nShort units are fine, too:\n\n```go\nt, err := when.Parse(\"6h ago\")\n```\n\nYou don't need to use durations at all:\n\n```go\nt, err := when.Parse(\"Jan 2nd at 3pm\")\n```\n\nBut if you do, they can be made relative to a specific time:\n\n```go\nt, err := when.Parse(\"6 hours from Jan 2nd at 3pm\")\n```\n\nAgain, but in reverse:\n\n```go\nt, err := when.Parse(\"6 hours before Jan 2nd at 3pm\")\n```\n\nYou can be a bit more casual with the time:\n\n```go\nt, err := when.Parse(\"3 o'clock in the afternoon\")\n```\n\nOr you can go full tilt:\n\n```go\ns := \"1y 2M and 3w \u0026 4d, 5h\"\ns += \" from quarter past 3 o'clock in the afternoon\"\ns += \" on the 2nd Tuesday of March\"\ns += \" + 6 minutes - 7 seconds\"\nt, err := when.Parse(s)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnelson%2Fwhen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpnelson%2Fwhen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnelson%2Fwhen/lists"}