{"id":16560,"library":"tzdata-etcetera","title":"IANA Time Zone Database (Etc. Zones)","description":"The `tzdata-etcetera` package provides a specific subset of the IANA Time Zone Database, focusing exclusively on the 'etcetera' zones such as Etc/GMT, Etc/UTC, and GMT. It delivers this data directly as a JSON file, intended for consumption by applications that require up-to-date time zone definitions without needing the entire global dataset. As of version 1.0.48, it incorporates the IANA TZ database release 2026a. The package maintains a regular release cadence, typically updating shortly after new IANA TZ database releases, which occur several times a year to reflect changes in time zone rules globally. This modular approach allows developers to include only the necessary time zone data, minimizing bundle size, and it is often used in conjunction with libraries like `timezonecomplete` for time zone calculations. Its primary differentiator is its granular focus on a specific zone category and its direct JSON output.","status":"active","version":"1.0.48","language":"javascript","source_language":"en","source_url":"https://github.com/rogierschouten/tzdata-generate","tags":["javascript"],"install":[{"cmd":"npm install tzdata-etcetera","lang":"bash","label":"npm"},{"cmd":"yarn add tzdata-etcetera","lang":"bash","label":"yarn"},{"cmd":"pnpm add tzdata-etcetera","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package primarily provides a CommonJS export of the JSON data. Direct ESM import might work in some bundlers or Node versions that support JSON modules, but `require` is the explicitly documented and most reliable method.","wrong":"import jsonData from 'tzdata-etcetera';","symbol":"tzdataEtcetera","correct":"var jsonData = require('tzdata-etcetera');"},{"note":"When loaded directly in a browser via a script tag, the data is exposed as a global variable `tzdataEtcetera`.","symbol":"tzdataEtcetera (browser global)","correct":"<script src=\"./tzdata-etcetera.js\"></script>\n<script>\n    function onLoad() {\n        var data = tzdataEtcetera;\n    }\n</script>"}],"quickstart":{"code":"const tzdataEtcetera = require('tzdata-etcetera');\n\n// Example: Accessing data for a specific zone\nconst gmtPlus5Data = tzdataEtcetera['Etc/GMT+5'];\n\nif (gmtPlus5Data) {\n  console.log('Etc/GMT+5 data:', gmtPlus5Data);\n  console.log('Sample rule for Etc/GMT+5:', gmtPlus5Data[0]);\n} else {\n  console.log('Etc/GMT+5 data not found.');\n}\n\n// List all zones included in this package\nconsole.log('\\nZones included in tzdata-etcetera:');\nObject.keys(tzdataEtcetera).forEach(zone => {\n  console.log(`- ${zone}`);\n});","lang":"javascript","description":"Demonstrates how to import the 'etcetera' time zone data in Node.js and access specific zone definitions."},"warnings":[{"fix":"Regularly update the package to ensure the most current time zone data. Be aware that past time calculations might produce different results with newer data.","message":"The underlying IANA Time Zone Database frequently updates time zone rules (e.g., daylight saving changes, standard time shifts, new zones). While the package API remains stable, the data itself changes, which can alter time calculations for affected regions.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Update application logic to no longer expect or handle a 'null' timezone entry. Verify any parsing or validation routines that might have relied on this specific entry.","message":"Version 1.0.45 removed a 'null' timezone entry. Consumers explicitly relying on the presence or structure of a 'null' entry might experience breakage.","severity":"breaking","affected_versions":">=1.0.45"},{"fix":"Treat the imported value as a plain JavaScript object (from JSON). Access time zone data directly via property lookup, e.g., `tzdataEtcetera['Etc/GMT']`.","message":"This package exports raw JSON data, not a module with functions or classes. Attempting to destructure or call methods on the imported data will fail.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[],"ecosystem":"npm"}