{"id":51330647,"url":"https://github.com/leeoniya/timezones","last_synced_at":"2026-07-01T22:32:25.199Z","repository":{"id":368637868,"uuid":"1285776719","full_name":"leeoniya/timezones","owner":"leeoniya","description":null,"archived":false,"fork":false,"pushed_at":"2026-07-01T13:06:25.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-01T15:08:31.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/leeoniya.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-01T06:15:58.000Z","updated_at":"2026-07-01T13:06:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/leeoniya/timezones","commit_stats":null,"previous_names":["leeoniya/timezones"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/leeoniya/timezones","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leeoniya%2Ftimezones","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leeoniya%2Ftimezones/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leeoniya%2Ftimezones/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leeoniya%2Ftimezones/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leeoniya","download_url":"https://codeload.github.com/leeoniya/timezones/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leeoniya%2Ftimezones/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35025980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-07-01T22:32:23.148Z","updated_at":"2026-07-01T22:32:25.194Z","avatar_url":"https://github.com/leeoniya.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Timezones\n\nDependency-free TypeScript utility for listing available IANA time zones with\ntheir short names and UTC offsets at a specific instant.\n\n```ts\nimport { listTimeZonesAt } from \"./src\";\n\nconst zones = listTimeZonesAt(Date.UTC(2024, 6, 15, 12));\n\nconsole.log(zones.find((zone) =\u003e zone.name === \"America/New_York\"));\n// {\n//   name: \"America/New_York\",\n//   abbr: \"EDT\",\n//   offset: \"-04:00\"\n// }\n```\n\n## API\n\n### `listTimeZonesAt(timestamp, strategy?)`\n\nReturns one entry per time zone:\n\n```ts\ninterface TimeZoneInfo {\n  name: string;\n  abbr: string;\n  offset: string;\n}\n```\n\n`timestamp` is a numeric UTC millisecond timestamp.\n\n`strategy` can be `\"conservative\"`, `\"balanced\"`, or `\"fastest\"`. It defaults\nto `\"conservative\"`.\n\n```ts\nlistTimeZonesAt(Date.UTC(2024, 6, 15, 12), \"fastest\");\n```\n\n`\"conservative\"` uses one `Intl.DateTimeFormat` per time zone.\nThis is the most accurate option.\n\n`\"balanced\"` uses one formatter per generated\noffset-to-abbreviation group. This reduces formatter count while accepting\ncurrent-ish approximation around transition edge cases.\n\n`\"fastest\"` uses static offsets for zones with one generated\noffset and one formatter per multi-offset group. This is the fastest and most\napproximate option.\n\n## Performance Notes\n\nThe utility uses a generated current-ish offset-to-abbreviation lookup in\n`src/timezone-abbreviations.ts`. The generator prefers system tzdata\nabbreviations, such as `NZST`/`NZDT` and `AEST`/`AEDT`, and falls back to\n`Intl` only while generating if the system lookup is unavailable. At runtime the\nutility uses the generated table for the time zone list and abbreviations. It\nstill asks `Intl` for the UTC offset at the requested timestamp, then picks the\nmatching abbreviation from the static table.\n\nThis avoids formatting localized short names for every zone on every call while\nstill letting the timestamp decide whether the zone is on standard time or\ndaylight time. If the runtime's current tzdata no longer matches the generated\ntable, the utility falls back to the first generated abbreviation for that zone.\n\nRegenerate the table after runtime or tzdata updates:\n\n```sh\nnpm run generate\n```\n\n## Scripts\n\n```sh\nnpm install --ignore-scripts\nnpm run build\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleeoniya%2Ftimezones","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleeoniya%2Ftimezones","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleeoniya%2Ftimezones/lists"}