{"id":15658935,"url":"https://github.com/hexagon/minitz","last_synced_at":"2025-05-04T08:36:20.994Z","repository":{"id":58882330,"uuid":"533933958","full_name":"Hexagon/minitz","owner":"Hexagon","description":"Minimal utility to convert to or from any timezone. Deno/Node/Browser. ESM/CommonJS.","archived":false,"fork":false,"pushed_at":"2023-12-03T19:25:58.000Z","size":984,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-03T23:45:47.351Z","etag":null,"topics":["commonjs-modules","date","es-module","esm","javascript","time","timezone-conversion","typescript"],"latest_commit_sha":null,"homepage":"http://minitz.56k.guru/","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/Hexagon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["hexagon"],"ko_fi":"hexagon_56k"}},"created_at":"2022-09-07T20:37:57.000Z","updated_at":"2024-07-15T12:15:35.000Z","dependencies_parsed_at":"2023-02-18T06:15:20.961Z","dependency_job_id":"c9b6e071-4f82-4f8f-8a4d-88df413b2a08","html_url":"https://github.com/Hexagon/minitz","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hexagon%2Fminitz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hexagon%2Fminitz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hexagon%2Fminitz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hexagon%2Fminitz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hexagon","download_url":"https://codeload.github.com/Hexagon/minitz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252310229,"owners_count":21727509,"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":["commonjs-modules","date","es-module","esm","javascript","time","timezone-conversion","typescript"],"created_at":"2024-10-03T13:14:27.840Z","updated_at":"2025-05-04T08:36:20.975Z","avatar_url":"https://github.com/Hexagon.png","language":"JavaScript","readme":"# minitz\n\n[![Node.js CI](https://github.com/Hexagon/minitz/actions/workflows/node.js.yml/badge.svg)](https://github.com/Hexagon/minitz/actions/workflows/node.js.yml) [![Deno CI](https://github.com/Hexagon/minitz/actions/workflows/deno.yml/badge.svg)](https://github.com/Hexagon/minitz/actions/workflows/deno.yml)\n[![npm version](https://badge.fury.io/js/minitz.svg)](https://badge.fury.io/js/minitz) [![NPM Downloads](https://img.shields.io/npm/dm/minitz.svg)](https://www.npmjs.org/package/minitz) [![jsdelivr](https://data.jsdelivr.com/v1/package/gh/hexagon/minitz/badge?style=rounded)](https://www.jsdelivr.com/package/gh/hexagon/minitz) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/4978bdbf495941c087ecb32b120f28ff)](https://www.codacy.com/gh/Hexagon/minitz/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=Hexagon/minitz\u0026amp;utm_campaign=Badge_Grade)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Hexagon/minitz/blob/main/LICENSE)\n\nMinitz offers an efficient way to manage and manipulate time zone in native JavaScript Date objects. With a modern ES-module design and full typings, minitz is compatible with any environment that supports JavaScript or TypeScript. Highlights:\n\n*   Convert dates between any timezone supported by the system.\n*   Parses ISO8601 time strings.\n*   MIT licensed, use the library any way you want. For real.\n*   Minimal (less than 2 KB minified), no dependencies. Relies on JavaScript Intl and current best practices.\n*   Works in Node.js \u003e=14.0 (both require and import).\n*   Works in Deno \u003e=1.8.\n*   Works in Bun \u003e=0.2.2\n*   Works in browsers as standalone, UMD or ES-module.\n*   Includes [TypeScript](https://www.typescriptlang.org/) typings.\n\nTry Minitz live on [jsfiddle](https://jsfiddle.net/hexag0n/3mheu5by/)\n\nCheck out the full documentation at [minitz.56k.guru](https://minitz.56k.guru)\n\n## Usage\n\nWhile converting a Date object to another timezone in JavaScript is achievable using the Intl feature of vanilla JS, things can get complicated when you want to convert date/time from another timezone or between different timezones. See the following examples:\n\nVanilla js for converting **to** a specific time zone:\n\n```javascript\n// Get current time in Asia/Tokyo, using vanilla js\nnew Date().toLocaleString(\"sv-SE\", { timeZone: \"Asia/Tokyo\" });\n// -\u003e 2022-09-15 17:23:45\n```\n\nUsing minitz to convert **from** and **across** different time zones:\n\n```javascript\n// Get local time from time in Asia/Tokyo, using minitz and vanilla js\nconst localTime = minitz(2022,9,15,23,0,0,\"Asia/Tokyo\")\nconsole.log( localTime.toLocaleString(\"sv-SE\") );\n// -\u003e 2022-09-15 16:00:00\n```\n\n```javascript\n// Get time in America/New_York from time in Asia/Tokyo, using minitz and vanilla js\n// Also demonstrates that it's possible to use ISO8601 strings as input to minitz, \n// through `.fromTZISO`\nconst localTime = minitz.fromTZISO(\"2022-09-15 23:00:00\",\"Asia/Tokyo\");\nconsole.log( localTime.toLocaleString(\"sv-SE\", { timeZone: \"America/New_York\" }) );\n// -\u003e 2022-09-15 10:00:00\n```\n\n## Installation\n\nDetails on installation for various platforms, including Node.js, Deno, Bun, and browsers, can be found in the [full documentation](https://minitz.56k.guru). A few installation commands are:\n\nNode.js: `npm install minitz`\n\nDeno: `import minitz from \"https://deno.land/x/minitz@4.0.6/src/minitz.js\";`\n\nBun: `bun add minitz`\n\nFor CDN, refer to the documentation.\n\n## Contributing\n\nAny contributions are welcome. See the [Contribution guide](https://minitz.56k.guru/contributing.html) to get started.\n\n## Donations\n\nIf you found this library helpful and wish to support its development, consider making a donation through [Hexagon's GitHub Sponsors page](https://github.com/sponsors/hexagon). Your generosity ensures the library's continued development and maintenance.\n\n## License\n\nMIT\n","funding_links":["https://github.com/sponsors/hexagon","https://ko-fi.com/hexagon_56k"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexagon%2Fminitz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexagon%2Fminitz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexagon%2Fminitz/lists"}