{"id":22423371,"url":"https://github.com/prantlf/timezone-support","last_synced_at":"2025-04-04T11:16:45.212Z","repository":{"id":44789965,"uuid":"145323192","full_name":"prantlf/timezone-support","owner":"prantlf","description":"Lightweight time zone support for your applications or other date libraries.","archived":false,"fork":false,"pushed_at":"2023-10-03T16:05:06.000Z","size":2220,"stargazers_count":119,"open_issues_count":21,"forks_count":29,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T10:11:18.623Z","etag":null,"topics":["conversion","convert","date","offset","time","time-zone","timezone","timezone-conversion","tz","tzdata","utc","utc-offsets"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/prantlf.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}},"created_at":"2018-08-19T17:18:32.000Z","updated_at":"2025-02-06T06:02:28.000Z","dependencies_parsed_at":"2024-06-18T12:40:27.516Z","dependency_job_id":"c6e5940e-bea2-4f64-92b4-d35520662e11","html_url":"https://github.com/prantlf/timezone-support","commit_stats":{"total_commits":113,"total_committers":9,"mean_commits":"12.555555555555555","dds":"0.10619469026548678","last_synced_commit":"881efbed7f7b0670be86b6bd26629b0c5a3b7d32"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Ftimezone-support","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Ftimezone-support/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Ftimezone-support/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prantlf%2Ftimezone-support/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prantlf","download_url":"https://codeload.github.com/prantlf/timezone-support/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166169,"owners_count":20894654,"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":["conversion","convert","date","offset","time","time-zone","timezone","timezone-conversion","tz","tzdata","utc","utc-offsets"],"created_at":"2024-12-05T18:10:47.475Z","updated_at":"2025-04-04T11:16:45.191Z","avatar_url":"https://github.com/prantlf.png","language":"JavaScript","readme":"# Time Zone Support\n\n[![Latest version](https://img.shields.io/npm/v/timezone-support)\n ![Dependency status](https://img.shields.io/librariesio/release/npm/timezone-support)\n](https://www.npmjs.com/package/timezone-support)\n[![Coverage](https://codecov.io/gh/prantlf/timezone-support/branch/master/graph/badge.svg)](https://codecov.io/gh/prantlf/timezone-support)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9f1034029c0747a980cd49f64f16338b)](https://www.codacy.com/app/prantlf/timezone-support?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=prantlf/timezone-support\u0026amp;utm_campaign=Badge_Grade)\n\n\nLightweight time zone listing and date converting. Intended for adding time zone support to high-level date libraries, but also for direct application usage.\n\n* Tiny code base - 4.6 KB minified, 1.7 KB gzipped. Do not pack unnecessary weight in your application.\n* Packed time zone data - 924 KB minified, 33.6 KB gzipped. Single time zones are unpacked on demand.\n* Smaller bundles of code with limited data - 1900-2050 (206 kB minified, 25.4 kB gzipped), 1970-2038 (141 kB minified, 15.8 kB gzipped) and 2012-2022 (31.3 KB minified, 8.25 kB gzipped).\n* Generated from the official time zone database version 2022f. Canonical time zone names, aliases, UTC offsets, and daylight-saving time changes.\n* ESM, UMD and CJS module formats provided.\n* Minimal interface for time zone lookup and conversions. Parsing, formatting and manipulating dates is usually the task for a higher-level date library.\n\n**Attention**: exported identifiers in vanilla browser modules changed in the version 2.0.0. See the [migration guide] for more information.\n\n### Table of Contents\n\n- [Synopsis](#synopsis)\n- [Installation and Getting Started](#installation-and-getting-started)\n- [Usage Scenarios](./docs/usage.md#usage-scenarios)\n- [Design Concepts](./docs/design.md#design-concepts)\n- [API Reference](./docs/API.md#api-reference)\n- [Library Integrations](#library-integrations)\n- [Contributing](#contributing)\n- [Release History](#release-history)\n- [License](#license)\n\n## Synopsis\n\n```js\nconst {\n  listTimeZones, findTimeZone, getZonedTime, getUnixTime\n} = require('timezone-support')\n\n// List canonical time zone names: [ 'Africa/Abidjan', ... ]\nconst timeZones = listTimeZones()\n\n// Find a particular time zone: { name: 'Europe/Berlin', ... }\nconst berlin = findTimeZone('Europe/Berlin')\n\n// Convert a date to a specific time zone: { year, month, day, dayOfWeek,\n// hours, minutes, seconds, milliseconds, epoch, zone: { abbreviation, offset } }\nconst nativeDate = new Date()\nconst berlinTime = getZonedTime(nativeDate, berlin)\n\n// Convert a time from a specific time zone: native Date object\nconst berlinTime = { year: 2018, month: 9, day: 2, hours: 10, minutes: 0 }\nconst nativeDate = new Date(getUnixTime(berlinTime, berlin))\n```\n\n## Installation and Getting Started\n\nThis module can be installed in your project using [NPM], [PNPM] or [Yarn]. Make sure, that you use [Node.js] version 14.8 or newer.\n\n```sh\n$ npm i timezone-support\n$ pnpm i timezone-support\n$ yarn add timezone-support\n```\n\nFunctions are exposed as named exports from the package modules, for example:\n\n```js\nconst { findTimeZone, getZonedTime } = require('timezone-support')\n```\n\nYou can read more about the [module loading] in other environments, like with ES6 or in web browsers. [Usage scenarios] demonstrate applications of this library in typical real-world scenarios. [Design concepts] explain the approach to time zone handling taken by tni library and types of values used ion the interface. [Generating custom time zone data] will allow you to save the overall package size by limiting the supported year span. Finally, the [API reference] lists all functions with a description of their functionality.\n\nYou can see [complete sample applications] too, which can help you start with integration of this library.\n\n## Library Integrations\n\n* [Day.js] - [timeZone plugin] supplies parsing from and formatting to an arbitrary time zone\n* [date-fns] - [date-fns-timezone] provides functions for parsing from and formatting to an arbitrary time zone and time zone conversions for the native `Date` object.\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style.  Add unit tests for any new or changed functionality. Lint and test your code using Grunt.\n\n## License\n\nCopyright (c) 2018-2022 Ferdinand Prantl\n\nLicensed under the MIT license.\n\n[Node.js]: http://nodejs.org/\n[NPM]: https://www.npmjs.com/\n[PNPM]: https://pnpm.io/\n[Yarn]: https://yarnpkg.com/\n[Day.js]: https://github.com/iamkun/dayjs\n[date-fns]: https://github.com/date-fns/date-fns\n[timeZone plugin]: https://github.com/prantlf/dayjs/blob/combined/docs/en/Plugin.md#timezone\n[date-fns-timezone]: https://github.com/prantlf/date-fns-timezone\n[migration guide]: docs/migration.md#migration-from-1x-to-2x\n[complete sample applications]: examples#readme\n[module loading]: ./docs/API.md#loading\n[Usage scenarios]: ./docs/usage.md#usage-scenarios\n[Design concepts]: ./docs/design.md#design-concepts\n[Generating custom time zone data]: ./docs/usage.md#generate-custom-time-zone-data\n[API reference]: ./docs/API.md#api-reference\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Ftimezone-support","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprantlf%2Ftimezone-support","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprantlf%2Ftimezone-support/lists"}