Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
jsonData
✓ const jsonData = require('tzdata-backward-utc');
✗ import jsonData from 'tzdata-backward-utc';
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`.
tzdataBackwardUtc
✓ <!-- In browser HTML --> <script src="./tzdata-backward-utc.js"></script> <script> var data = tzdataBackwardUtc; </script>
✗ const data = tzdataBackwardUtc;
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.
tzData
✓ import tzData from 'tzdata-backward-utc';
✗ import { tzData } from 'tzdata-backward-utc';
When using ESM in Node.js (or bundlers), the JSON data is the default export. There are no named exports from this module.
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.
const backwardUtcData = require('tzdata-backward-utc');
console.log('Loaded backward-utc timezone data (truncated):');
console.log(Object.keys(backwardUtcData).slice(0, 5).map(key => `${key}: ${JSON.stringify(backwardUtcData[key]).slice(0, 50)}...`));
// Example of accessing a specific zone, e.g., 'UTC'
const utcZoneInfo = backwardUtcData['UTC'];
if (utcZoneInfo) {
console.log('\nInformation for UTC zone (truncated):');
console.log(JSON.stringify(utcZoneInfo, null, 2).slice(0, 200) + '...');
} else {
console.log('\nUTC zone information not found.');
}
// Demonstrate use of the IANA TZ Database version property (added in v1.0.46)
if (backwardUtcData.version) {
console.log(`\nIANA TZ Database Version: ${backwardUtcData.version}`);
} else {
console.log('\nVersion property not found (older package version).');
}
Debug
Known issues
breakingThe 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.fixRegularly 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.
affects: All versions, as it reflects upstream IANA TZ data updates.
gotchaThis 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.fixFor 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`.
affects: All versions
gotchaThis 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.fixEnsure `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.
affects: <=1.0.48
Errors
Common errors & fixes
TypeError: tzdataBackwardUtc is not defined
Attempting to access the browser global variable `tzdataBackwardUtc` in a Node.js environment.
fixIn 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. Cannot find module 'tzdata-backward-utc'
The package has not been installed, or the import path is incorrect.
fixEnsure the package is installed using `npm install tzdata-backward-utc` and that the import statement matches the package name exactly.
SyntaxError: Named export 'tzData' not found. The requested module 'tzdata-backward-utc' does not provide an export named 'tzData'
Attempting to use a named import for a module that provides a default export (the JSON object itself) but no named exports.
fixUse a default import instead: `import tzData from 'tzdata-backward-utc';` for ESM, or `const tzData = require('tzdata-backward-utc');` for CommonJS. Audit
Dependencies
tzdata-etceterarequiredThis module's data contains links to zones in `tzdata-etcetera` for complete resolution of time zone information.