tzdata-backward
raw JSON → 1.0.49 verified Sat Apr 25 auth: no javascript
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.
Common errors
error Cannot find module 'tzdata-backward' ↓
cause Package not installed or missing from node_modules
fix
npm install tzdata-backward
error Error: Cannot find module 'tzdata-africa' (and similar peer deps) ↓
cause Peer dependencies not installed automatically by npm
fix
npm install tzdata-africa tzdata-asia tzdata-australasia tzdata-etcetera tzdata-europe tzdata-northamerica tzdata-southamerica
error TypeError: require(...) is not a function ↓
cause Using ES module import syntax on CJS module without proper bundler or node --experimental-require-module
fix
Use 'const tz = require("tzdata-backward")' or use dynamic import with await import('tzdata-backward')
Warnings
gotcha Missing peer dependencies will cause zone links to fail when resolving time zone data. ↓
fix Install all peer dependencies: tzdata-africa, tzdata-asia, tzdata-australasia, tzdata-etcetera, tzdata-europe, tzdata-northamerica, tzdata-southamerica.
breaking When upgrading from tzdata 2023c to 2023d, zone 'America/Godthab' was removed (replaced by 'America/Nuuk'). ↓
fix Replace references to 'America/Godthab' with 'America/Nuuk'.
deprecated The 'backward' module is intended only for backward compatibility; prefer canonical zone names from the primary tzdata modules. ↓
fix Use zone data from tzdata (main) or region-specific modules (e.g., tzdata-northamerica) instead of relying on backward links.
gotcha 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. ↓
fix Manually follow the 'links' if present in the zone object? Actually data does not include resolution; user must handle linking logic externally.
breaking tdata 2024a introduced Kazakhstan time zone changes (Asia/Almaty, Asia/Qostanay) affecting backward links. ↓
fix Update cached zone data and verify calculations for Asia/Almaty and Asia/Qostanay.
Install
npm install tzdata-backward yarn add tzdata-backward pnpm add tzdata-backward Imports
- default wrong
import tz from 'tzdata-backward';correctconst tz = require('tzdata-backward'); - default (browser UMD) wrong
<script src='tzdata-backward.js'><script>const data = require('tzdata-backward');correct<script src='tzdata-backward.js'><script>const data = tzdataBackward; - default (ESM via bundler) wrong
const tz = require('tzdata-backward');correctimport tz from 'tzdata-backward'; // may require bundler config
Quickstart
const tz = require('tzdata-backward');
console.log('Number of zones:', Object.keys(tz).length);
// Example zone data
const zone = 'America/Atka';
console.log('Zone ' + zone + ' exists:', zone in tz);
// List first 3 zones
const names = Object.keys(tz).slice(0,3);
console.log('First zones:', names);
if (names.length > 0) {
const firstZone = tz[names[0]];
console.log('Data shape for ' + names[0] + ':', firstZone);
}