{"id":16559,"library":"tzdata-backward-utc","title":"IANA TZ Database for Backward UTC Zones","description":"The `tzdata-backward-utc` package provides a specialized subset of the IANA Time Zone Database, specifically containing old synonyms for `Etc/UTC` and `Etc/GMT` zones, represented as a single JSON file. Maintained by Rogier Schouten, this package is part of a larger ecosystem of `tzdata` modules designed to offer granular access to time zone data. Its current stable version is `1.0.48`, updated to IANA TZ database version `2026a`, and it generally follows the release cadence of the upstream IANA TZ database, typically updating every few months to reflect the latest time zone rules, such as recent changes for Kazakhstan or Palestine. Key differentiators include its focus on a very specific historical subset of time zone data and its direct provision of the raw IANA data as a machine-readable JSON object, primarily intended for consumption by other timezone processing libraries like `timezonecomplete`, rather than being a timezone calculation library itself.","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-backward-utc","lang":"bash","label":"npm"},{"cmd":"yarn add tzdata-backward-utc","lang":"bash","label":"yarn"},{"cmd":"pnpm add tzdata-backward-utc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This module's data contains links to zones in `tzdata-etcetera` for complete resolution of time zone information.","package":"tzdata-etcetera","optional":false}],"imports":[{"note":"This package is primarily consumed as a JSON module via CommonJS `require()` in Node.js. While Node.js can often import JSON directly with ESM `import`, the documentation explicitly shows `require`.","wrong":"import jsonData from 'tzdata-backward-utc';","symbol":"jsonData","correct":"const jsonData = require('tzdata-backward-utc');"},{"note":"In a browser environment, the UMD module exposes the time zone data as a global variable `tzdataBackwardUtc`. This global is not available in Node.js environments.","wrong":"const data = tzdataBackwardUtc;","symbol":"tzdataBackwardUtc","correct":"<!-- In browser HTML --> <script src=\"./tzdata-backward-utc.js\"></script> <script> var data = tzdataBackwardUtc; </script>"},{"note":"When using ESM in Node.js (or bundlers), the JSON data is the default export. There are no named exports from this module.","wrong":"import { tzData } from 'tzdata-backward-utc';","symbol":"tzData","correct":"import tzData from 'tzdata-backward-utc';"}],"quickstart":{"code":"const backwardUtcData = require('tzdata-backward-utc');\n\nconsole.log('Loaded backward-utc timezone data (truncated):');\nconsole.log(Object.keys(backwardUtcData).slice(0, 5).map(key => `${key}: ${JSON.stringify(backwardUtcData[key]).slice(0, 50)}...`));\n\n// Example of accessing a specific zone, e.g., 'UTC'\nconst utcZoneInfo = backwardUtcData['UTC'];\nif (utcZoneInfo) {\n  console.log('\\nInformation for UTC zone (truncated):');\n  console.log(JSON.stringify(utcZoneInfo, null, 2).slice(0, 200) + '...');\n} else {\n  console.log('\\nUTC zone information not found.');\n}\n\n// Demonstrate use of the IANA TZ Database version property (added in v1.0.46)\nif (backwardUtcData.version) {\n  console.log(`\\nIANA TZ Database Version: ${backwardUtcData.version}`);\n} else {\n  console.log('\\nVersion property not found (older package version).');\n}","lang":"javascript","description":"This quickstart demonstrates how to import the `tzdata-backward-utc` JSON data in Node.js and access its content, including specific zone information and the embedded IANA TZ Database version."},"warnings":[{"fix":"Regularly update `tzdata-backward-utc` to the latest version to ensure you are using the most current time zone rules. Be aware that time zone calculations for past or future dates may change with updates.","message":"The IANA Time Zone Database, which this package mirrors, is updated periodically to reflect changes in political time zone boundaries, UTC offsets, and daylight-saving rules. These are data changes, not API changes, but they directly affect time calculations for historical or future dates.","severity":"breaking","affected_versions":"All versions, as it reflects upstream IANA TZ data updates."},{"fix":"For full IANA time zone support, combine this module with the main `tzdata` package or other regional `tzdata-*` modules, typically integrated through a library like `timezonecomplete`.","message":"This package is a specific subset of the IANA TZ database, containing only old synonyms for `Etc/UTC` and `Etc/GMT`. It does not provide comprehensive time zone data for all regions globally. Using it in isolation for general time zone handling will lead to incomplete or incorrect results.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure `tzdata-etcetera` is installed alongside `tzdata-backward-utc` using `npm install tzdata-backward-utc tzdata-etcetera` or ensure your package manager correctly resolves peer dependencies.","message":"This module lists `tzdata-etcetera` as a peer dependency. While npm 7+ handles peer dependencies automatically, older npm versions (or other package managers) might require manual installation, or incorrect installation could lead to missing data links.","severity":"gotcha","affected_versions":"<=1.0.48"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"In Node.js, use `const data = require('tzdata-backward-utc');` to import the module's JSON content. The global variable is only available when the UMD bundle is loaded in a browser.","cause":"Attempting to access the browser global variable `tzdataBackwardUtc` in a Node.js environment.","error":"TypeError: tzdataBackwardUtc is not defined"},{"fix":"Ensure the package is installed using `npm install tzdata-backward-utc` and that the import statement matches the package name exactly.","cause":"The package has not been installed, or the import path is incorrect.","error":"Cannot find module 'tzdata-backward-utc'"},{"fix":"Use a default import instead: `import tzData from 'tzdata-backward-utc';` for ESM, or `const tzData = require('tzdata-backward-utc');` for CommonJS.","cause":"Attempting to use a named import for a module that provides a default export (the JSON object itself) but no named exports.","error":"SyntaxError: Named export 'tzData' not found. The requested module 'tzdata-backward-utc' does not provide an export named 'tzData'"}],"ecosystem":"npm"}