{"id":18325041,"url":"https://github.com/maxdeviant/bigben","last_synced_at":"2026-01-21T13:01:53.877Z","repository":{"id":233075951,"uuid":"785935273","full_name":"maxdeviant/bigben","owner":"maxdeviant","description":"🕰️ A clock abstraction, with time travel","archived":false,"fork":false,"pushed_at":"2025-07-26T17:38:12.000Z","size":21,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-23T00:56:50.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Gleam","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/maxdeviant.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-13T00:21:27.000Z","updated_at":"2025-07-26T17:37:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"50633de3-b0cf-4326-9248-91a8e5be126b","html_url":"https://github.com/maxdeviant/bigben","commit_stats":null,"previous_names":["maxdeviant/bigben"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/maxdeviant/bigben","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdeviant%2Fbigben","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdeviant%2Fbigben/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdeviant%2Fbigben/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdeviant%2Fbigben/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxdeviant","download_url":"https://codeload.github.com/maxdeviant/bigben/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxdeviant%2Fbigben/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28633747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"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":"2024-11-05T18:36:38.678Z","updated_at":"2026-01-21T13:01:53.856Z","avatar_url":"https://github.com/maxdeviant.png","language":"Gleam","readme":"# bigben\n\n[![Package Version](https://img.shields.io/hexpm/v/bigben)](https://hex.pm/packages/bigben)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/bigben/)\n![Erlang-compatible](https://img.shields.io/badge/target-erlang-b83998)\n![JavaScript-compatible](https://img.shields.io/badge/target-javascript-f1e05a)\n\n🕰️ A clock abstraction, with time travel.\n\n## Installation\n\n```sh\ngleam add bigben\n```\n\n## Usage\n\n```gleam\nimport bigben/clock.{type Clock}\nimport bigben/fake_clock\nimport gleam/int\nimport gleam/io\nimport gleam/time/calendar\nimport gleam/time/duration\nimport gleam/time/timestamp\n\npub fn main() {\n  // In your production code, you'll use the real `Clock` to get the time\n  // from the system:\n  let clock = clock.new()\n  what_day_is_it(clock)\n  // Today is July 26, 2025.\n\n  // In test code you can construct a `FakeClock`:\n  let assert Ok(now) = timestamp.parse_rfc3339(\"2024-04-08T02:26:31.464Z\")\n  let fake_clock = fake_clock.new_at(now)\n  // and pass it off as a real `Clock`:\n  let clock = clock.from_fake(fake_clock)\n\n  what_day_is_it(clock)\n  // Today is April 8, 2024.\n\n  // We can then manipulate the clock to help us in our tests:\n  fake_clock.advance(fake_clock, duration.hours(4 * 24))\n\n  what_day_is_it(clock)\n  // Today is April 12, 2024.\n}\n\nfn what_day_is_it(clock: Clock) {\n  let #(date, _time) =\n    clock |\u003e clock.now |\u003e timestamp.to_calendar(calendar.utc_offset)\n\n  let month = date.month |\u003e calendar.month_to_string\n  let day = date.day |\u003e int.to_string\n  let year = date.year |\u003e int.to_string\n\n  io.println(\"Today is \" \u003c\u003e month \u003c\u003e \" \" \u003c\u003e day \u003c\u003e \", \" \u003c\u003e year \u003c\u003e \".\")\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxdeviant%2Fbigben","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxdeviant%2Fbigben","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxdeviant%2Fbigben/lists"}