{"id":18880,"library":"tzdata-backward","title":"tzdata-backward","description":"Part of the IANA time zone database (backward compatibility zones) distributed as JSON for Node.js and browsers. Version 1.0.49 corresponds to tzdata 2026b. This module is part of a split package strategy, requiring peer dependencies for other region modules (tzdata-africa, tzdata-asia, etc.) because the data contains links to zones in those modules. Designed primarily for use with timezonecomplete library, but usable standalone for time zone data consumption. Releases follow IANA tzdata releases. The 'backward' module contains historical zone names that map to canonical zones.","status":"active","version":"1.0.49","language":"javascript","source_language":"en","source_url":"https://github.com/rogierschouten/tzdata-generate","tags":["javascript"],"install":[{"cmd":"npm install tzdata-backward","lang":"bash","label":"npm"},{"cmd":"yarn add tzdata-backward","lang":"bash","label":"yarn"},{"cmd":"pnpm add tzdata-backward","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: contains zones linked from backward data","package":"tzdata-australasia","optional":false},{"reason":"peer dependency: contains zones linked from backward data","package":"tzdata-southamerica","optional":false},{"reason":"peer dependency: contains zones linked from backward data","package":"tzdata-europe","optional":false},{"reason":"peer dependency: contains zones linked from backward data","package":"tzdata-northamerica","optional":false},{"reason":"peer dependency: contains zones linked from backward data","package":"tzdata-africa","optional":false},{"reason":"peer dependency: contains zones linked from backward data","package":"tzdata-etcetera","optional":false},{"reason":"peer dependency: contains zones linked from backward data","package":"tzdata-asia","optional":false}],"imports":[{"note":"Package uses CommonJS, not ESM. ESM dynamic import works: import('tzdata-backward')","wrong":"import tz from 'tzdata-backward';","symbol":"default","correct":"const tz = require('tzdata-backward');"},{"note":"UMD global is tzdataBackward","wrong":"<script src='tzdata-backward.js'><script>const data = require('tzdata-backward');","symbol":"default (browser UMD)","correct":"<script src='tzdata-backward.js'><script>const data = tzdataBackward;"},{"note":"No ESM package.json 'type' field; bundlers often handle CJS->ESM","wrong":"const tz = require('tzdata-backward');","symbol":"default (ESM via bundler)","correct":"import tz from 'tzdata-backward'; // may require bundler config"}],"quickstart":{"code":"const tz = require('tzdata-backward');\nconsole.log('Number of zones:', Object.keys(tz).length);\n// Example zone data\nconst zone = 'America/Atka';\nconsole.log('Zone ' + zone + ' exists:', zone in tz);\n// List first 3 zones\nconst names = Object.keys(tz).slice(0,3);\nconsole.log('First zones:', names);\nif (names.length > 0) {\n  const firstZone = tz[names[0]];\n  console.log('Data shape for ' + names[0] + ':', firstZone);\n}","lang":"javascript","description":"Load the tzdata-backward JSON in Node.js, examine a zone's existence, and inspect data shape."},"warnings":[{"fix":"Install all peer dependencies: tzdata-africa, tzdata-asia, tzdata-australasia, tzdata-etcetera, tzdata-europe, tzdata-northamerica, tzdata-southamerica.","message":"Missing peer dependencies will cause zone links to fail when resolving time zone data.","severity":"gotcha","affected_versions":"*"},{"fix":"Replace references to 'America/Godthab' with 'America/Nuuk'.","message":"When upgrading from tzdata 2023c to 2023d, zone 'America/Godthab' was removed (replaced by 'America/Nuuk').","severity":"breaking","affected_versions":">=1.0.39"},{"fix":"Use zone data from tzdata (main) or region-specific modules (e.g., tzdata-northamerica) instead of relying on backward links.","message":"The 'backward' module is intended only for backward compatibility; prefer canonical zone names from the primary tzdata modules.","severity":"deprecated","affected_versions":"*"},{"fix":"Manually follow the 'links' if present in the zone object? Actually data does not include resolution; user must handle linking logic externally.","message":"The JSON keys are zone names (e.g., 'America/Atka') but some are aliases that redirect to canonical zones. The value is the raw zone data, not a reference resolution.","severity":"gotcha","affected_versions":"*"},{"fix":"Update cached zone data and verify calculations for Asia/Almaty and Asia/Qostanay.","message":"tdata 2024a introduced Kazakhstan time zone changes (Asia/Almaty, Asia/Qostanay) affecting backward links.","severity":"breaking","affected_versions":">=1.0.40"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install tzdata-backward","cause":"Package not installed or missing from node_modules","error":"Cannot find module 'tzdata-backward'"},{"fix":"npm install tzdata-africa tzdata-asia tzdata-australasia tzdata-etcetera tzdata-europe tzdata-northamerica tzdata-southamerica","cause":"Peer dependencies not installed automatically by npm","error":"Error: Cannot find module 'tzdata-africa' (and similar peer deps)"},{"fix":"Use 'const tz = require(\"tzdata-backward\")' or use dynamic import with await import('tzdata-backward')","cause":"Using ES module import syntax on CJS module without proper bundler or node --experimental-require-module","error":"TypeError: require(...) is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}